Opened 6 years ago
Closed 6 years ago
#29437 closed Bug (wontfix)
Formset.media collect Form.Media and Field.widget.media not correct
Reported by: | Maxim Danilov | Owned by: | nobody |
---|---|---|---|
Component: | Forms | Version: | |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
in Django.forms.formsets.py (django 1.9)
@property def media(self): # All the forms on a FormSet are the same, so you only need to interrogate the first form for media. if self.forms: return self.forms[0].media else: return self.empty_form.media
But formset have 3 types of form:
1.bound from for existed objects.
2.unbound from for new objects.
3.the empty form for JS "add new row".
All of them are NOT the same.
The every Form can have own fields.widget and field.widget.media
i think, we should make a possibility, to add a some media in form.init
Or we should collect media in the form.init moment. Not after. Not one time for one form.
Note:
See TracTickets
for help on using tickets.
Given some discussion about deprecating
Media
(#22298), I don't think we should spend time on this issue.