I have a form in my Django that looks something like this:
class PersonnelForm(forms.Form): """ Form for creating a new personnel. """ username = forms.RegexField( required=True, max_length=30, label=_("Name") ) is_manager = forms.BooleanField( required=True, label=_("Is Manager") )
I use this form in two places on my site. One of the places I would like to display the form and all its fields except the is_manager field, but I would like to set the default value of this field to True . Elsewhere, I would like to display the form and all its fields, including the is_manager field, and I would like it to have a default value of False.
How can i do this? This seems to be a trivial thing, but I cannot understand it.
Thanks.
source share