djangodocs.org

717 sections in Django dev Search all versions →

model

Reference Model forms Model form Meta API

ModelFormOptions.model : Required. The django.db.models.Model to be used for the ModelForm.

widgets

Reference Model forms Model form Meta API

ModelFormOptions.widgets : A dictionary that maps a model field name to a django.forms.Widget.

inlineformset_factory

Reference Model forms Model form factory functions

inlineformset_factory(parent_model,model,form=ModelForm,formset=BaseInlineFormSet,fk_name=None,fields=None,exclude=None,extra=3,can_order=False,can_delete=True,max_num=None,formfield_callback=None,widgets=None,validate_max=False,localized_fields=None,labels=None,help_texts=None,error_messages=None,min_num=None,validate_min=False,field_classes=None,absolute_max=None,can_delete_extra=True,renderer=None,edit_only=False)[source] : Returns an InlineFormSet using modelformset_factory() with defaults of formset=BaseInlineFormSet, can_delete=True, and extra=3.

New form wizard

Release notes Django 1.4 release notes What’s new in Django 1.4

The previous FormWizard from django.contrib.formtools has been replaced with a new implementation based on the class-based views introduced in Django 1.3.

Release notes Django 1.5 release notes Backwards incompatible changes in 1.5

request.POST will no longer include data posted via HTTP requests with non form-specific content-types in the header. In prior versions, data posted with content-types other than multipart/form-data or application/x-www-form-urlencoded would still end up represented in the request.POST attribute.

GeoDjango form widgets

Release notes Django 1.6 release notes What’s new in Django 1.6

GeoDjango now provides form fields and widgets for its geo-specialized fields. They are OpenLayers-based by default, but they can be customized to use any other JS framework.

Release notes Django 2.2 release notes Backwards incompatible changes in 2.2

Form Media assets are now merged using a topological sort algorithm, as the old pairwise merging algorithm is insufficient for some cases.

Release notes Django 4.0 release notes What’s new in Django 4.0

Forms, Formsets, and ErrorList are now rendered using the template engine to enhance customization. See the new render(), get_context(), and template_name for Form and formset rendering for Formset.