db.models.Variance

class Variance(expression, sample=False, **extra) [source] Returns the variance of the data in the provided expression. Default alias: <field>__variance Return type: float Has one optional argument: sample By default, Variance returns the population variance. However, if sample=True, the return value will be the sample variance. SQLite SQLite doesn’t provide Variance out of the box. An implementation is available as an extension module for SQLite. Consult the SQlite document

db.transaction.atomic()

atomic(using=None, savepoint=True) [source] Atomicity is the defining property of database transactions. atomic allows us to create a block of code within which the atomicity on the database is guaranteed. If the block of code is successfully completed, the changes are committed to the database. If there is an exception, the changes are rolled back. atomic blocks can be nested. In this case, when an inner block completes successfully, its effects can still be rolled back if an exception is r

db.models.URLField

class URLField(max_length=200, **options) [source] A CharField for a URL. The default form widget for this field is a TextInput. Like all CharField subclasses, URLField takes the optional max_length argument. If you don’t specify max_length, a default of 200 is used.

db.models.UUIDField

class UUIDField(**options) [source] A field for storing universally unique identifiers. Uses Python’s UUID class. When used on PostgreSQL, this stores in a uuid datatype, otherwise in a char(32). Universally unique identifiers are a good alternative to AutoField for primary_key. The database will not generate the UUID for you, so it is recommended to use default: import uuid from django.db import models class MyUUIDModel(models.Model): id = models.UUIDField(primary_key=True, default=uui

db.models.Transform.output_field

output_field Defines the class this transformation outputs. It must be a Field instance. By default is the same as its lhs.output_field.

db.models.Transform.lhs

lhs The left-hand side - what is being transformed. It must follow the Query Expression API.

db.models.Transform.lookup_name

lookup_name The name of the lookup, used for identifying it on parsing query expressions. It cannot contain the string "__".

db.models.Transform

class Transform [source] A Transform is a generic class to implement field transformations. A prominent example is __year that transforms a DateField into a IntegerField. The notation to use a Transform in an lookup expression is <expression>__<transformation> (e.g. date__year). This class follows the Query Expression API, which implies that you can use <expression>__<transform1>__<transform2>. It’s a specialized Func() expression that only accepts one argument.

db.models.TextField

class TextField(**options) [source] A large text field. The default form widget for this field is a Textarea. If you specify a max_length attribute, it will be reflected in the Textarea widget of the auto-generated form field. However it is not enforced at the model or database level. Use a CharField for that. MySQL users If you are using this field with MySQLdb 1.2.1p2 and the utf8_bin collation (which is not the default), there are some issues to be aware of. Refer to the MySQL database n

db.models.Transform.bilateral

bilateral A boolean indicating whether this transformation should apply to both lhs and rhs. Bilateral transformations will be applied to rhs in the same order as they appear in the lookup expression. By default it is set to False. For example usage, see Custom Lookups.