db.models.Field.editable

Field.editable If False, the field will not be displayed in the admin or any other ModelForm. They are also skipped during model validation. Default is True.

db.models.Field.description

description A verbose description of the field, e.g. for the django.contrib.admindocs application. The description can be of the form: description = _("String (up to %(max_length)s)") where the arguments are interpolated from the field’s __dict__. To map a Field to a database-specific type, Django exposes several methods:

db.models.Field.default

Field.default The default value for the field. This can be a value or a callable object. If callable it will be called every time a new object is created. The default can’t be a mutable object (model instance, list, set, etc.), as a reference to the same instance of that object would be used as the default value in all new model instances. Instead, wrap the desired default in a callable. For example, if you want to specify a default dict for JSONField, use a function: def contact_default():

db.models.Field.deconstruct()

deconstruct() [source] Returns a 4-tuple with enough information to recreate the field: The name of the field on the model. The import path of the field (e.g. "django.db.models.IntegerField"). This should be the most portable version, so less specific may be better. A list of positional arguments. A dict of keyword arguments. This method must be added to fields prior to 1.7 to migrate its data using Migrations.

db.models.Field.db_type()

db_type(connection) [source] Returns the database column data type for the Field, taking into account the connection. See Custom database types for usage in custom fields.

db.models.Field.db_tablespace

Field.db_tablespace The name of the database tablespace to use for this field’s index, if this field is indexed. The default is the project’s DEFAULT_INDEX_TABLESPACE setting, if set, or the db_tablespace of the model, if any. If the backend doesn’t support tablespaces for indexes, this option is ignored.

db.models.Field.db_index

Field.db_index If True, a database index will be created for this field.

db.models.Field.db_column

Field.db_column The name of the database column to use for this field. If this isn’t given, Django will use the field’s name. If your database column name is an SQL reserved word, or contains characters that aren’t allowed in Python variable names – notably, the hyphen – that’s OK. Django quotes column and table names behind the scenes.

db.models.Field.concrete

Field.concrete Boolean flag that indicates if the field has a database column associated with it.

db.models.Field.choices

Field.choices An iterable (e.g., a list or tuple) consisting itself of iterables of exactly two items (e.g. [(A, B), (A, B) ...]) to use as choices for this field. If this is given, the default form widget will be a select box with these choices instead of the standard text field. The first element in each tuple is the actual value to be set on the model, and the second element is the human-readable name. For example: YEAR_IN_SCHOOL_CHOICES = ( ('FR', 'Freshman'), ('SO', 'Sophomore')