summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2007-02-13 18:04:47 +0000
committerAdrian Holovaty <adrian@holovaty.com>2007-02-13 18:04:47 +0000
commit9efa60dafbfa9f23423c6babb8de56e028f24c49 (patch)
tree4c9cb11647325e02ebed179a127d96189ea99626 /django
parentc61d7e195f2fb3bebbd124ff814af3a8c2e59c1f (diff)
Fixed #3489 -- Changed newforms to use copy.copy() in constructing self.fields, so changes to self.fields in a given form instance do not affect other instances
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4504 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
-rw-r--r--django/newforms/forms.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/django/newforms/forms.py b/django/newforms/forms.py
index 7e29941bef..0b90b09e2c 100644
--- a/django/newforms/forms.py
+++ b/django/newforms/forms.py
@@ -7,6 +7,7 @@ from django.utils.html import escape
from fields import Field
from widgets import TextInput, Textarea, HiddenInput, MultipleHiddenInput
from util import flatatt, StrAndUnicode, ErrorDict, ErrorList, ValidationError
+import copy
__all__ = ('BaseForm', 'Form')
@@ -27,7 +28,7 @@ class SortedDictFromList(SortedDict):
dict.__init__(self, dict(data))
def copy(self):
- return SortedDictFromList(self.items())
+ return SortedDictFromList([(k, copy.copy(v)) for k, v in self.items()])
class DeclarativeFieldsMetaclass(type):
"Metaclass that converts Field attributes to a dictionary called 'base_fields'."