diff options
Diffstat (limited to 'django/db/models/sql')
| -rw-r--r-- | django/db/models/sql/where.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/django/db/models/sql/where.py b/django/db/models/sql/where.py index 160d5733b8..50ff13be75 100644 --- a/django/db/models/sql/where.py +++ b/django/db/models/sql/where.py @@ -148,7 +148,11 @@ class WhereNode(tree.Node): clone = self.__class__._new_instance( children=None, connector=self.connector, negated=self.negated, ) - clone.children = self.children[:] + for child in self.children: + if hasattr(child, 'clone'): + clone.children.append(child.clone()) + else: + clone.children.append(child) return clone def relabeled_clone(self, change_map): |
