#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):

 I had no idea! It works perfectly. Consider this a documentation bug
 report, then. :)

 First, it might be nice to note this requirement here:

 
https://docs.djangoproject.com/en/1.7/ref/forms/fields/#django.forms.ModelMultipleChoiceField

 And just say that, if you want to hide the input, you have to use
 MultipleHiddenInput. Second, the HiddenInput widget documentation (which I
 did look at) says this:

 > Note that there also is a MultipleHiddenInput widget that encapsulates a
 set of hidden input elements.

 "A set of hidden input elements" is not at all how I was thinking of a
 ManyToManyField. Perhaps something like "that is used to hide inputs that
 return multiple values". Or, "that return a list of values". Or...

 What would probably be nicest is to have a way to say
 `fields["authors"].hidden = True`, and let Django figure it out. That
 would be a much larger project, however.

 Also I found this intriguing, though incomprehensible:

 https://docs.djangoproject.com/en/1.7/releases/1.7.3/#database-denial-of-
 service-with-modelmultiplechoicefield

 Thanks very much for your help.

--
Ticket URL: <https://code.djangoproject.com/ticket/24453#comment:4>
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.a0a13e48c0b7c8a5d88c068f52155eaf%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to