I have a modelchoicefield that has too many valid options to really show in a menu. How can I tell Django forms to use another widget that won’t take up as much space rendering?
I want to use a HiddenField and I have another widget on the screen taht will populate it. If the hiddenfield has no value I keep getting form validation errors on it even though it is marked as required=false
All you need to do is use the
widgetparameter of the form field definition…But the question really is what other widget would you like to use?
There are some examples of autocomplete widgets. But nothing out of the box.