[Django] #29437: Formset.media collect Form.Media and Field.widget.media not correct

14 views
Skip to first unread message

Django

unread,
May 23, 2018, 5:40:16 AM5/23/18
to django-...@googlegroups.com
#29437: Formset.media collect Form.Media and Field.widget.media not correct
--------------------------------------+------------------------
Reporter: danilovmy | Owner: nobody
Type: Bug | Status: new
Component: Forms | Version:
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
--------------------------------------+------------------------
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.

--
Ticket URL: <https://code.djangoproject.com/ticket/29437>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jun 21, 2018, 1:45:13 PM6/21/18
to django-...@googlegroups.com
#29437: Formset.media collect Form.Media and Field.widget.media not correct
---------------------------+--------------------------------------
Reporter: danilovmy | Owner: nobody
Type: Bug | Status: closed
Component: Forms | Version:
Severity: Normal | Resolution: wontfix

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------+--------------------------------------
Changes (by Tim Graham):

* status: new => closed
* resolution: => wontfix


Comment:

Given some discussion about deprecating `Media` (#22298), I don't think we
should spend time on this issue.

--
Ticket URL: <https://code.djangoproject.com/ticket/29437#comment:1>

Reply all
Reply to author
Forward
0 new messages