diff options
author | Anssi Kääriäinen <akaariai@gmail.com> | 2013-03-02 01:06:56 +0200 |
---|---|---|
committer | Anssi Kääriäinen <akaariai@gmail.com> | 2013-03-12 21:33:47 +0200 |
commit | d744c550d51955fd623897884446b7f34318e94d (patch) | |
tree | 1521502743849636f9ced88992ce2c33b7f6e12c /django/db/models/sql/datastructures.py | |
parent | 679af4058dae8a54438d95ceb943f449e78448c1 (diff) | |
download | django-d744c550d51955fd623897884446b7f34318e94d.tar.gz |
Fixed #19964 -- Removed relabel_aliases from some structs
Before there was need to have both .relabel_aliases() and .clone() for
many structs. Now there is only relabeled_clone() for those structs
where alias is the only mutable attribute.
Diffstat (limited to 'django/db/models/sql/datastructures.py')
-rw-r--r-- | django/db/models/sql/datastructures.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/django/db/models/sql/datastructures.py b/django/db/models/sql/datastructures.py index 4bc9e6ed34..daaabbe6da 100644 --- a/django/db/models/sql/datastructures.py +++ b/django/db/models/sql/datastructures.py @@ -32,10 +32,8 @@ class Date(object): self.col = col self.lookup_type = lookup_type - def relabel_aliases(self, change_map): - c = self.col - if isinstance(c, (list, tuple)): - self.col = (change_map.get(c[0], c[0]), c[1]) + def relabeled_clone(self, change_map): + return self.__class__((change_map.get(self.col[0], self.col[0]), self.col[1])) def as_sql(self, qn, connection): if isinstance(self.col, (list, tuple)): @@ -53,10 +51,8 @@ class DateTime(object): self.lookup_type = lookup_type self.tzname = tzname - def relabel_aliases(self, change_map): - c = self.col - if isinstance(c, (list, tuple)): - self.col = (change_map.get(c[0], c[0]), c[1]) + def relabeled_clone(self, change_map): + return self.__class__((change_map.get(self.col[0], self.col[0]), self.col[1])) def as_sql(self, qn, connection): if isinstance(self.col, (list, tuple)): |