Ticket #16759: query_carefull_clone.patch
File query_carefull_clone.patch, 1.5 KB (added by , 13 years ago) |
---|
-
django/db/models/sql/where.py
3 3 """ 4 4 import datetime 5 5 from itertools import repeat 6 from copy import copy 6 7 7 8 from django.utils import tree 8 9 from django.db.models.fields import Field … … 286 287 def __init__(self, alias, col, field): 287 288 self.alias, self.col, self.field = alias, col, field 288 289 290 def __deepcopy__(self, memodict): 291 return copy(self) 292 289 293 def __getstate__(self): 290 294 """Save the state of the Constraint for pickling. 291 295 -
django/db/models/sql/expressions.py
1 1 from django.core.exceptions import FieldError 2 2 from django.db.models.fields import FieldDoesNotExist 3 3 from django.db.models.sql.constants import LOOKUP_SEP 4 from copy import deepcopy 4 5 5 6 class SQLEvaluator(object): 6 7 def __init__(self, expression, query, allow_joins=True): … … 11 12 self.contains_aggregate = False 12 13 self.expression.prepare(self, query, allow_joins) 13 14 15 def __deepcopy__(self, memodict): 16 memodict[id(self.opts)] = self.opts 17 18 obj = self.__class__.__new__(self.__class__) 19 obj.__dict__ = deepcopy(self.__dict__, memodict) 20 return obj 21 14 22 def prepare(self): 15 23 return self 16 24