1
0
mirror of https://github.com/django/django.git synced 2025-07-04 01:39:20 +00:00

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
This commit is contained in:
Joseph Kocherhans 2007-09-24 23:23:54 +00:00
parent b94ae3b783
commit cb5dc33ce5

View File

@ -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)