From cb5dc33ce5a87caff9d6a4a7d770a2737db397ec Mon Sep 17 00:00:00 2001 From: Joseph Kocherhans Date: Mon, 24 Sep 2007 23:23:54 +0000 Subject: [PATCH] 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 --- django/contrib/admin/widgets.py | 6 ++++++ 1 file changed, 6 insertions(+) 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'Add Another' % 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)