db.models.as_sql()

as_sql(self, compiler, connection) Responsible for producing the query string and parameters for the expression. The compiler is an SQLCompiler object, which has a compile() method that can be used to compile other expressions. The connection is the connection used to execute the query. Calling expression.as_sql() is usually incorrect - instead compiler.compile(expression) should be used. The compiler.compile() method will take care of calling vendor-specific methods of the expression. Custo

db.models.as_vendorname()

as_vendorname(self, compiler, connection) Works like as_sql() method. When an expression is compiled by compiler.compile(), Django will first try to call as_vendorname(), where vendorname is the vendor name of the backend used for executing the query. The vendorname is one of postgresql, oracle, sqlite, or mysql for Django’s built-in backends.

db.models.AutoField

class AutoField(**options) [source] An IntegerField that automatically increments according to available IDs. You usually won’t need to use this directly; a primary key field will automatically be added to your model if you don’t specify otherwise. See Automatic primary key fields.

db.migrations.operations.SeparateDatabaseAndState

class SeparateDatabaseAndState(database_operations=None, state_operations=None) [source] A highly specialized operation that let you mix and match the database (schema-changing) and state (autodetector-powering) aspects of operations. It accepts two list of operations, and when asked to apply state will use the state list, and when asked to apply changes to the database will use the database list. Do not use this operation unless you’re very sure you know what you’re doing.

db.models.Aggregate.template

template A class attribute, as a format string, that describes the SQL that is generated for this aggregate. Defaults to '%(function)s( %(expressions)s )'.

db.migrations.operations.RunSQL.noop

RunSQL.noop Pass the RunSQL.noop attribute to sql or reverse_sql when you want the operation not to do anything in the given direction. This is especially useful in making the operation reversible. New in Django 1.10: The elidable argument was added.

db.models.Aggregate.function

function A class attribute describing the aggregate function that will be generated. Specifically, the function will be interpolated as the function placeholder within template. Defaults to None.

db.models.Aggregate

class Aggregate(expression, output_field=None, **extra) [source] template A class attribute, as a format string, that describes the SQL that is generated for this aggregate. Defaults to '%(function)s( %(expressions)s )'. function A class attribute describing the aggregate function that will be generated. Specifically, the function will be interpolated as the function placeholder within template. Defaults to None. The expression argument can be the name of a field on the model, or

db.migrations.operations.RunSQL

class RunSQL(sql, reverse_sql=None, state_operations=None, hints=None, elidable=False) [source] Allows running of arbitrary SQL on the database - useful for more advanced features of database backends that Django doesn’t support directly, like partial indexes. sql, and reverse_sql if provided, should be strings of SQL to run on the database. On most database backends (all but PostgreSQL), Django will split the SQL into individual statements prior to executing them. This requires installing t

db.migrations.operations.DeleteModel

class DeleteModel(name) [source] Deletes the model from the project history and its table from the database.