Changeset 7431
- Timestamp:
- 04/16/08 03:09:18 (5 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/queryset-refactor/django/db/models/base.py
r7345 r7431 1 import copy 1 2 import types 2 3 import sys … … 112 113 raise FieldError('Local field %r in class %r clashes with field of similar name from abstract base class %r' 113 114 % (field.name, name, base.__name__)) 114 new_class.add_to_class(field.name, field)115 new_class.add_to_class(field.name, copy.deepcopy(field)) 115 116 116 117 if abstract: django/branches/queryset-refactor/django/db/models/fields/__init__.py
r7341 r7431 1 import copy 1 2 import datetime 2 3 import os … … 127 128 128 129 def __deepcopy__(self, memodict): 129 # Slight hack; deepcopy() is difficult to do on classes with 130 # dynamically created methods. Fortunately, we can get away with doing 131 # a shallow copy in this particular case. 132 import copy 133 return copy.copy(self) 130 # We don't have to deepcopy very much here, since most things are not 131 # intended to be altered after initial creation. 132 obj = copy.copy(self) 133 if self.rel: 134 obj.rel = copy.copy(self.rel) 135 memodict[id(self)] = obj 136 return obj 134 137 135 138 def to_python(self, value):
