mirror of
https://github.com/django/django.git
synced 2025-10-25 06:36:07 +00:00
Fixed #10774: accessing form media types in templates (i.e. `{{ form.media.js }}`) now works. Thanks, tarequeh and Alex Gaynor.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10489 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -75,7 +75,7 @@ class Media(StrAndUnicode):
|
||||
def __getitem__(self, name):
|
||||
"Returns a Media object that only contains media of the given type"
|
||||
if name in MEDIA_TYPES:
|
||||
return Media(**{name: getattr(self, '_' + name)})
|
||||
return Media(**{str(name): getattr(self, '_' + name)})
|
||||
raise KeyError('Unknown media type "%s"' % name)
|
||||
|
||||
def add_js(self, data):
|
||||
|
||||
Reference in New Issue
Block a user