diff options
| author | Jacob Kaplan-Moss <jacob@jacobian.org> | 2009-04-10 17:10:44 +0000 |
|---|---|---|
| committer | Jacob Kaplan-Moss <jacob@jacobian.org> | 2009-04-10 17:10:44 +0000 |
| commit | ca5b624b05be5e9315cfd149afcd542b66279b4b (patch) | |
| tree | 7f82e8e8712d3b4f8df497c6ad6fbdeed2323eca /django/forms | |
| parent | 53af4523297ea1df783c045410fc36ea6520c46b (diff) | |
[1.0.X] Fixed #10774: accessing form media types in templates (i.e. ``{{ form.media.js }}``) now works. Thanks, tarequeh and Alex Gaynor. Backport of r10489 from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10491 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/forms')
| -rw-r--r-- | django/forms/widgets.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/forms/widgets.py b/django/forms/widgets.py index ab1142c180..1ac64ac6b9 100644 --- a/django/forms/widgets.py +++ b/django/forms/widgets.py @@ -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): |
