Home | History | Annotate | Download | only in tko

Lines Matching refs:query

26     def _get_group_query_sql(self, query, group_by):
27 compiler = query.query.get_compiler(using=query.db)
31 # insert GROUP BY clause into query
32 group_fields = self._get_field_names(group_by, query.query.extra_select)
54 def execute_group_query(self, query, group_by):
55 """Performs the given query grouped by the specified fields.
57 The given query's extra select fields are added.
59 @param query: The query to perform.
67 sql, params = self._get_group_query_sql(query, group_by)
75 def get_count_sql(self, query):
76 """Get SQL to select a per-group count of unique matches for a query.
78 @param query: The query to use.
83 if query.query.distinct:
91 def _get_num_groups_sql(self, query, group_by):
92 group_fields = self._get_field_names(group_by, query.query.extra_select)
93 query = query.order_by() # this can mess up the query and isn't needed
95 compiler = query.query.get_compiler(using=query.db)
108 def get_num_groups(self, query, group_by):
109 """Gets the number of distinct groups for a query.
111 @param query: The query to use.
114 @return The number of distinct groups for the given query grouped by
118 sql, params = self._get_num_groups_sql(query, group_by)
301 """Models a saved query."""
318 query = super(TestViewManager, self).get_query_set()
323 return query.extra(select=extra_select)
361 query_set.query.add_custom_join('tko_test_labels',
363 query_set.query.LOUTER,
369 label_ids = list( # listifying avoids a double query below
426 Join the given TestView QuerySet to TestAttribute. The resulting query
460 # otherwise each join will expand the query by the number of
482 The resulting query looks like a TestView query but has one row per
486 We accomplish this by joining the TestView query to IterationResult
650 query = self.model.query_objects(filter_data,
652 dicts = query.values('test_idx')