Changes between Initial Version and Version 1 of Ticket #15127


Ignore:
Timestamp:
Jan 20, 2011, 7:28:56 PM (14 years ago)
Author:
Karen Tracey
Comment:

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 
     1From `django.forms.forms.BaseForm.__init__`, it seems the intention is that a form's self.fields should be safe to update
     2{{{
     3#!python
    34        # The base_fields class attribute is the *class-wide* definition of
    45        # fields. Because a particular *instance* of the class might want to
     
    78        # self.base_fields.
    89        self.fields = deepcopy(self.base_fields)
    9 
     10}}}
    1011Yet
    1112{{{
     
    5556}}}
    5657
    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__:
     58So it seems that the instance field is definitely a deep copy, but the attributes of are not. A friend then pointed out `Field.__deepcopy__`:
    5859
    5960http://code.djangoproject.com/browser/django/trunk/django/forms/fields.py#L193
Back to Top