def query_simple_group(self, group_by='', filters=None): query = self.session.query(self.obj) query = self._get_base_query(query=query, filters=filters) query_result = query.all() #query_result = sorted(query_result, key=lambda item: getattr(item, group_by)) group = GroupByCol(group_by, 'Group by') return group.apply(query_result)
def query_simple_group(self, group_by="", aggregate_func=None, aggregate_col=None, filters=None): query = self.session.query(self.obj) query = self._get_base_query(query=query, filters=filters) query_result = query.all() group = GroupByCol(group_by, "Group by") return group.apply(query_result)