-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Django allows the user to attach additional css/js resources to a form or a widget.
Currently, FormCollection
s can have a Media
class to provide additional resources for themselves to use, however they don't collect the media defined in their forms (and these forms' fields by extension).
I did this not-so-dirty fix in my project (based on the media method of the django Form
class), which if I understand the codebase correctly would account for nested collections if this was the media property of the FormCollection
class :
@property
def media(self):
"""Return all media for forms in this collection"""
media = Media()
for form in self.declared_holders.values():
media += form.media
return media
This allows to only use {{ form_collection.media }}
in the template, and not search for the collection's sub forms explicitly.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request