db.models.Count

class Count(expression, distinct=False, **extra) [source] Returns the number of objects that are related through the provided expression. Default alias: <field>__count Return type: int Has one optional argument: distinct If distinct=True, the count will only include unique instances. This is the SQL equivalent of COUNT(DISTINCT <field>). The default value is False.

db.models.CommaSeparatedIntegerField

class CommaSeparatedIntegerField(max_length=None, **options) [source] Deprecated since version 1.9: This field is deprecated in favor of CharField with validators=[validate_comma_separated_integer_list]. A field of integers separated by commas. As in CharField, the max_length argument is required and the note about database portability mentioned there should be heeded.

db.models.CharField.max_length

CharField.max_length The maximum length (in characters) of the field. The max_length is enforced at the database level and in Django’s validation. Note If you are writing an application that must be portable to multiple database backends, you should be aware that there are restrictions on max_length for some backends. Refer to the database backend notes for details. MySQL users If you are using this field with MySQLdb 1.2.2 and the utf8_bin collation (which is not the default), there are

db.models.CharField

class CharField(max_length=None, **options) [source] A string field, for small- to large-sized strings. For large amounts of text, use TextField. The default form widget for this field is a TextInput. CharField has one extra required argument:

db.models.CASCADE

CASCADE [source] Cascade deletes. Django emulates the behavior of the SQL constraint ON DELETE CASCADE and also deletes the object containing the ForeignKey.

db.models.BooleanField

class BooleanField(**options) [source] A true/false field. The default form widget for this field is a CheckboxInput. If you need to accept null values then use NullBooleanField instead. The default value of BooleanField is None when Field.default isn’t defined.

db.models.BinaryField

class BinaryField(**options) [source] A field to store raw binary data. It only supports bytes assignment. Be aware that this field has limited functionality. For example, it is not possible to filter a queryset on a BinaryField value. It is also not possible to include a BinaryField in a ModelForm. Abusing BinaryField Although you might think about storing files in the database, consider that it is bad design in 99% of the cases. This field is not a replacement for proper static files hand

db.models.BigIntegerField

class BigIntegerField(**options) [source] A 64-bit integer, much like an IntegerField except that it is guaranteed to fit numbers from -9223372036854775808 to 9223372036854775807. The default form widget for this field is a TextInput.

db.models.BigAutoField

class BigAutoField(**options) [source] New in Django 1.10. A 64-bit integer, much like an AutoField except that it is guaranteed to fit numbers from 1 to 9223372036854775807.

db.models.Avg

class Avg(expression, output_field=FloatField(), **extra) [source] Returns the mean value of the given expression, which must be numeric unless you specify a different output_field. Default alias: <field>__avg Return type: float (or the type of whatever output_field is specified) Changed in Django 1.9: The output_field parameter was added to allow aggregating over non-numeric columns, such as DurationField.