Contents Creating forms from models ModelForm Field types A full example Validation on a ModelForm Overriding the clean() method Interaction with model validation Considerations regarding model’s error_messages The save() method Selecting the fields to use Overriding the default fields Enabling localization of fields Form inheritance Providing initial values ModelForm factory function Model formsets Changing the queryset Changing the form Specifying widgets to use in the form with widgets Enabling localization for fields with localized_fields Providing initial values Saving objects in the formset Limiting the number of editable objects Using a model formset in a view Overriding clean() on a ModelFormSet Using a custom queryset Using the formset in the template Inline formsets Overriding methods on an InlineFormSet More than one foreign key to the same model Using an inline formset in a view Specifying widgets to use in the inline form
Created
July 13, 2018 10:09
-
-
Save amelieykw/f4f85293c79c2adc3a07f7c5d7906277 to your computer and use it in GitHub Desktop.
[Creating forms from models.md] #forms #models #Django #Creating_forms_from_models
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment