Author: jkocherhans
Date: 2007-09-24 18:23:54 -0500 (Mon, 24 Sep 2007)
New Revision: 6415

Modified:
   django/branches/newforms-admin/django/contrib/admin/widgets.py
Log:
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.

Modified: django/branches/newforms-admin/django/contrib/admin/widgets.py
===================================================================
--- django/branches/newforms-admin/django/contrib/admin/widgets.py      
2007-09-24 22:18:00 UTC (rev 6414)
+++ django/branches/newforms-admin/django/contrib/admin/widgets.py      
2007-09-24 23:23:54 UTC (rev 6415)
@@ -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 @@
                 (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)


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to