diff options
author | Alban Gruin | 2017-01-28 12:38:46 +0100 |
---|---|---|
committer | Alban Gruin | 2017-01-28 12:41:01 +0100 |
commit | c45de02b8ae2f976157e59ea36c6b39cd2bc0a0f (patch) | |
tree | 6b9e74d67b1df408c0264f70c07b59b8bcb09f5e | |
parent | 5c52392e274757c09b05f62581c52a197cb51ce6 (diff) |
Réimplémentation du clonage de GroupedQuerydev/db-groupby-with-sql
-rw-r--r-- | db.py | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -23,6 +23,11 @@ class GroupedQuery(Query): super(GroupedQuery, self).__init__(model, where) self.real_group_by = [] + def clone(self, klass=None, memo=None, **kwargs): + obj = super(GroupedQuery, self).clone(klass, memo, **kwargs) + obj.real_group_by = self.real_group_by[:] + return obj + def add_grouping(self, *grouping): self.real_group_by.extend(grouping) |