Changes between Initial Version and Version 1 of Ticket #15127
- Timestamp:
- Jan 20, 2011, 7:28:56 PM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #15127 – Description
initial v1 1 From django.forms.forms.BaseForm.__init__, it seems the intention is that a form's self.fields should be safe to update 2 1 From `django.forms.forms.BaseForm.__init__`, it seems the intention is that a form's self.fields should be safe to update 2 {{{ 3 #!python 3 4 # The base_fields class attribute is the *class-wide* definition of 4 5 # fields. Because a particular *instance* of the class might want to … … 7 8 # self.base_fields. 8 9 self.fields = deepcopy(self.base_fields) 9 10 }}} 10 11 Yet 11 12 {{{ … … 55 56 }}} 56 57 57 So it seems that the instance field is definitely a deep copy, but the attributes of are not. A friend then pointed out Field.__deepcopy__:58 So it seems that the instance field is definitely a deep copy, but the attributes of are not. A friend then pointed out `Field.__deepcopy__`: 58 59 59 60 http://code.djangoproject.com/browser/django/trunk/django/forms/fields.py#L193