db.models.Field.formfield()

formfield(form_class=None, choices_form_class=None, **kwargs) [source]

Returns the default django.forms.Field of this field for ModelForm.

By default, if both form_class and choices_form_class are None, it uses CharField. If the field has choices and choices_form_class isn’t specified, it uses TypedChoiceField.

See Specifying the form field for a model field for usage.

doc_Django
2016-10-09 18:35:25
Comments
Leave a Comment

Please login to continue.