db.models.Field.is_relation

Field.is_relation Boolean flag that indicates if a field contains references to one or more other models for its functionality (e.g. ForeignKey, ManyToManyField, OneToOneField, etc.).

db.models.Field.hidden

Field.hidden Boolean flag that indicates if a field is used to back another non-hidden field’s functionality (e.g. the content_type and object_id fields that make up a GenericForeignKey). The hidden flag is used to distinguish what constitutes the public subset of fields on the model from all the fields on the model. Note Options.get_fields() excludes hidden fields by default. Pass in include_hidden=True to return hidden fields in the results.

db.models.Field.help_text

Field.help_text Extra “help” text to be displayed with the form widget. It’s useful for documentation even if your field isn’t used on a form. Note that this value is not HTML-escaped in automatically-generated forms. This lets you include HTML in help_text if you so desire. For example: help_text="Please use the following format: <em>YYYY-MM-DD</em>." Alternatively you can use plain text and django.utils.html.escape() to escape any HTML special characters. Ensure that you escap

db.models.Field.get_prep_value()

get_prep_value(value) [source] value is the current value of the model’s attribute, and the method should return data in a format that has been prepared for use as a parameter in a query. See Converting Python objects to query values for usage.

db.models.Field.get_internal_type()

get_internal_type() [source] Returns a string naming this field for backend specific purposes. By default, it returns the class name. See Emulating built-in field types for usage in custom fields.

db.models.Field.get_db_prep_value()

get_db_prep_value(value, connection, prepared=False) [source] Converts value to a backend-specific value. By default it returns value if prepared=True and get_prep_value() if is False. See Converting query values to database values for usage. When loading data, from_db_value() is used:

db.models.Field.get_db_prep_save()

get_db_prep_save(value, connection) [source] Same as the get_db_prep_value(), but called when the field value must be saved to the database. By default returns get_db_prep_value().

db.models.Field.from_db_value()

from_db_value(value, expression, connection, context) Converts a value as returned by the database to a Python object. It is the reverse of get_prep_value(). This method is not used for most built-in fields as the database backend already returns the correct Python type, or the backend itself does the conversion. See Converting values to Python objects for usage. Note For performance reasons, from_db_value is not implemented as a no-op on fields which do not require it (all Django fields).

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.

db.models.Field.error_messages

Field.error_messages The error_messages argument lets you override the default messages that the field will raise. Pass in a dictionary with keys matching the error messages you want to override. Error message keys include null, blank, invalid, invalid_choice, unique, and unique_for_date. Additional error message keys are specified for each field in the Field types section below.