#24453: Initial values for ManyToMany form fields can't be hidden
------------------------+--------------------------------------
Reporter: girzel | Owner: nobody
Type: Bug | Status: new
Component: Forms | Version: 1.7
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------+--------------------------------------
Comment (by girzel):
Thanks for the response! I previously tried it with a list of pks instead
of instances, and it behaves exactly the same way (the value shows up in
the HTML as "[37L]" in both cases), with the same error. I'm constructing
a list of field names to be hidden, and putting them in a variable called
"hidden", and then:
{{{
WorkFormSet = modelformset_factory(Work,
widgets=dict([(f, forms.HiddenInput())
for f in hidden]),)
}}}
That's how I hide them. It works correctly for any field that isn't a
ManyToManyField.
Should I be hiding this field some other way?
--
Ticket URL: <https://code.djangoproject.com/ticket/24453#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/064.3981b82e64c0ff25d1b76da39b8c205d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.