db.models.fields.files.FieldFile.close()

FieldFile.close() [source] Behaves like the standard Python file.close() method and closes the file associated with this instance.

db.models.fields.files.FieldFile

class FieldFile [source] When you access a FileField on a model, you are given an instance of FieldFile as a proxy for accessing the underlying file. The API of FieldFile mirrors that of File, with one key difference: The object wrapped by the class is not necessarily a wrapper around Python’s built-in file object. Instead, it is a wrapper around the result of the Storage.open() method, which may be a File object, or it may be a custom storage’s implementation of the File API. In addition to

db.models.Field.unique_for_year

Field.unique_for_year Like unique_for_date and unique_for_month.

db.models.Field.unique_for_month

Field.unique_for_month Like unique_for_date, but requires the field to be unique with respect to the month.

db.models.Field.verbose_name

Field.verbose_name A human-readable name for the field. If the verbose name isn’t given, Django will automatically create it using the field’s attribute name, converting underscores to spaces. See Verbose field names.

db.models.Field.validators

Field.validators A list of validators to run for this field. See the validators documentation for more information.

db.models.Field.value_to_string()

value_to_string(obj) [source] Converts obj to a string. Used to serialize the value of the field. See Converting field data for serialization for usage. When using model forms, the Field needs to know which form field it should be represented by:

db.models.Field.unique

Field.unique If True, this field must be unique throughout the table. This is enforced at the database level and by model validation. If you try to save a model with a duplicate value in a unique field, a django.db.IntegrityError will be raised by the model’s save() method. This option is valid on all field types except ManyToManyField, OneToOneField, and FileField. Note that when unique is True, you don’t need to specify db_index, because unique implies the creation of an index.

db.models.Field.to_python()

to_python(value) [source] Converts the value into the correct Python object. It acts as the reverse of value_to_string(), and is also called in clean(). See Converting values to Python objects for usage. Besides saving to the database, the field also needs to know how to serialize its value:

db.models.Field.unique_for_date

Field.unique_for_date Set this to the name of a DateField or DateTimeField to require that this field be unique for the value of the date field. For example, if you have a field title that has unique_for_date="pub_date", then Django wouldn’t allow the entry of two records with the same title and pub_date. Note that if you set this to point to a DateTimeField, only the date portion of the field will be considered. Besides, when USE_TZ is True, the check will be performed in the current time z