Code

Ticket #17556: media_inherit.diff

File media_inherit.diff, 664 bytes (added by ojo, 2 years ago)
Line 
1Index: django/forms/widgets.py
2===================================================================
3--- django/forms/widgets.py     (revision 17377)
4+++ django/forms/widgets.py     (working copy)
5@@ -8,6 +8,7 @@
6 import datetime
7 from itertools import chain
8 from urlparse import urljoin
9+from inspect import getmembers
10 
11 from django.conf import settings
12 from django.forms.util import flatatt, to_current_timezone
13@@ -32,7 +33,7 @@
14 class Media(StrAndUnicode):
15     def __init__(self, media=None, **kwargs):
16         if media:
17-            media_attrs = media.__dict__
18+            media_attrs = dict(getmembers(media))
19         else:
20             media_attrs = kwargs
21