Ticket #10774: form_media_key_access.patch

File form_media_key_access.patch, 569 bytes (added by Tareque Hossain, 16 years ago)

Proposed fix for form media subtype access (via key) bug

  • django/forms/widgets.py

     
    7575    def __getitem__(self, name):
    7676        "Returns a Media object that only contains media of the given type"
    7777        if name in MEDIA_TYPES:
    78             return Media(**{name: getattr(self, '_' + name)})
     78            return Media(**{str(name): getattr(self, '_' + name)})
    7979        raise KeyError('Unknown media type "%s"' % name)
    8080
    8181    def add_js(self, data):
Back to Top