diff options
| author | Joseph Kocherhans <joseph@jkocherhans.com> | 2007-09-24 23:23:54 +0000 |
|---|---|---|
| committer | Joseph Kocherhans <joseph@jkocherhans.com> | 2007-09-24 23:23:54 +0000 |
| commit | cb5dc33ce5a87caff9d6a4a7d770a2737db397ec (patch) | |
| tree | c91adecdcd2a63fe0b9d2bb6c2c3187f72308b2c | |
| parent | b94ae3b783b97e5bd5c10aa88da70e746d7d313c (diff) | |
newforms-admin: Fixed a deepcopy bug in RelatedFieldWidgetWrapper. This should probably be addressed in the base Widget class in trunk, but I'm not going to make that call. Refs #5505.
git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@6415 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/contrib/admin/widgets.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/django/contrib/admin/widgets.py b/django/contrib/admin/widgets.py index 7ce0d36023..492e9d6e6e 100644 --- a/django/contrib/admin/widgets.py +++ b/django/contrib/admin/widgets.py @@ -1,6 +1,7 @@ """ Form Widget classes specific to the Django admin site. """ +import copy from django import newforms as forms from django.utils.datastructures import MultiValueDict @@ -131,3 +132,8 @@ class RelatedFieldWidgetWrapper(object): (related_url, name)) output.append(u'<img src="%simg/admin/icon_addlink.gif" width="10" height="10" alt="Add Another"/></a>' % settings.ADMIN_MEDIA_PREFIX) return u''.join(output) + + def __deepcopy__(self, memo): + # There is no reason to deepcopy self.admin_site, etc, so just return + # a shallow copy. + return copy.copy(self) |
