Browse files

newforms-admin: Fixed a deepcopy bug in RelatedFieldWidgetWrapper. Th…

…is 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: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent b94ae3b commit cb5dc33ce5a87caff9d6a4a7d770a2737db397ec @jkocherhans jkocherhans committed Sep 24, 2007
Showing with 6 additions and 0 deletions.
  1. +6 −0 django/contrib/admin/
@@ -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 @@ def __call__(self, name, value, *args, **kwargs):
(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)

0 comments on commit cb5dc33

Please sign in to comment.