djangodocs.org

251 sections in Django 6.0 Search all versions →

ChoiceField

Reference Form fields Built-in Field classes

classChoiceField(**kwargs)[source] : - Default widget: Select - Empty value: '' (an empty string) - Normalizes to: A string. - Validates that the given value exists in the list of choices. - Error message keys: required, invalid_choice

FilePathField

Reference Form fields Built-in Field classes

classFilePathField(**kwargs)[source] : - Default widget: Select - Empty value: '' (an empty string) - Normalizes to: A string. - Validates that the selected choice exists in the list of choices. - Error message keys: required, invalid_choice

ModelChoiceField

Reference Form fields Fields which handle relationships

classModelChoiceField(**kwargs)[source] : - Default widget: Select - Empty value: None - Normalizes to: A model instance. - Validates that the given id exists in the queryset. - Error message keys: required, invalid_choice

NullBooleanSelect

Reference Widgets Built-in widgetsSelector and checkbox widgets

classNullBooleanSelect[source] : - template_name: 'django/forms/widgets/select.html' - option_template_name: 'django/forms/widgets/select_option.html'

SelectMultiple

Reference Widgets Built-in widgetsSelector and checkbox widgets

classSelectMultiple[source] : - template_name: 'django/forms/widgets/select.html' - option_template_name: 'django/forms/widgets/select_option.html'

SelectDateWidget

Reference Widgets Built-in widgetsComposite widgets

classSelectDateWidget[source] : - template_name: 'django/forms/widgets/select_date.html'

contains

Reference QuerySet API reference QuerySet APIField lookups

Case-sensitive containment test. Example: SQL equivalent: (The exact SQL syntax varies for each database engine.) Note this will match the headline 'Lennon honored today' but not 'lennon honored today'.

icontains

Reference QuerySet API reference QuerySet APIField lookups

Case-insensitive containment test. Example: SQL equivalent: (The exact SQL syntax varies for each database engine.) NOTE: When using the SQLite backend and non-ASCII strings, bear in mind the > database note about string comparisons.

startswith

Reference QuerySet API reference QuerySet APIField lookups

Case-sensitive starts-with. Example: SQL equivalent: (The exact SQL syntax varies for each database engine.) SQLite doesn’t support case-sensitive LIKE statements; startswith acts like istartswith for SQLite.

istartswith

Reference QuerySet API reference QuerySet APIField lookups

Case-insensitive starts-with. Example: SQL equivalent: (The exact SQL syntax varies for each database engine.) NOTE: When using the SQLite backend and non-ASCII strings, bear in mind the > database note about string comparisons.

endswith

Reference QuerySet API reference QuerySet APIField lookups

Case-sensitive ends-with. Example: SQL equivalent: (The exact SQL syntax varies for each database engine.) NOTE: SQLite doesn’t support case-sensitive LIKE statements; endswith > acts like iendswith for SQLite. Refer to the database note documentation for more.

iendswith

Reference QuerySet API reference QuerySet APIField lookups

Case-insensitive ends-with. Example: SQL equivalent: (The exact SQL syntax varies for each database engine.) NOTE: When using the SQLite backend and non-ASCII strings, bear in mind the > database note about string comparisons.

Deferring model fields

Topic guide Performing raw SQL queries Performing raw queries

Fields may also be left out: The Person objects returned by this query will be deferred model instances (see defer()). This means that the fields that are omitted from the query will be loaded on demand.

can_delete

Topic guide Formsets Dealing with ordering and deletion of forms

BaseFormSet.can_delete Default: False Lets you create a formset with the ability to select forms for deletion: Similar to can_order this adds a new field to each form named DELETE and is a forms.BooleanField.

Role

Internals Organization of the Django Project Steering council

The steering council is a group of experienced contributors who: provide oversight of Django’s development and release process, assist in setting the direction of feature development and releases, select Mergers and Releasers, and have a tie-breaking vote when other decision-making …

Admin actions

Reference

The basic workflow of Django’s admin is, in a nutshell, “select an object, then change it.” This works well for a majority of use cases.

left

Reference GIS QuerySet API Reference Spatial Lookups

Availability: PostGIS, PGRaster (Conversion) Tests if the geometry field’s bounding box is strictly to the left of the lookup geometry’s bounding box. Example: PostGIS equivalent:

right

Reference GIS QuerySet API Reference Spatial Lookups

Availability: PostGIS, PGRaster (Conversion) Tests if the geometry field’s bounding box is strictly to the right of the lookup geometry’s bounding box. Example: PostGIS equivalent: