class Func(SQLiteNumericMixin, Expression): (source)
Known subclasses: django.db.models.aggregates.Aggregate
, django.db.models.expressions.ExpressionList
, django.db.models.expressions.OrderByList
, django.db.models.functions.ATan2
, django.db.models.functions.Cast
, django.db.models.functions.Coalesce
, django.db.models.functions.Collate
, django.db.models.functions.Concat
, django.db.models.functions.ConcatPair
, django.db.models.functions.Greatest
, django.db.models.functions.JSONObject
, django.db.models.functions.Least
, django.db.models.functions.Left
, django.db.models.functions.Log
, django.db.models.functions.LPad
, django.db.models.functions.Mod
, django.db.models.functions.Now
, django.db.models.functions.NullIf
, django.db.models.functions.Pi
, django.db.models.functions.Power
, django.db.models.functions.Random
, django.db.models.functions.Repeat
, django.db.models.functions.Replace
, django.db.models.functions.StrIndex
, django.db.models.functions.Substr
, django.db.models.functions.window.CumeDist
, django.db.models.functions.window.DenseRank
, django.db.models.functions.window.FirstValue
, django.db.models.functions.window.LagLeadFunction
, django.db.models.functions.window.LastValue
, django.db.models.functions.window.NthValue
, django.db.models.functions.window.Ntile
, django.db.models.functions.window.PercentRank
, django.db.models.functions.window.Rank
, django.db.models.functions.window.RowNumber
, django.db.models.indexes.IndexExpression
, django.db.models.lookups.Transform
An SQL function call.
Method | __init__ |
Undocumented |
Method | __repr__ |
Undocumented |
Method | as |
Responsible for returning a (sql, [params]) tuple to be included in the current query. |
Method | copy |
Undocumented |
Method | get |
Undocumented |
Method | resolve |
Provide the chance to do any preprocessing or validation before being added to the query. |
Method | set |
Undocumented |
Class Variable | arg |
Undocumented |
Class Variable | arity |
Undocumented |
Class Variable | function |
Undocumented |
Class Variable | template |
Undocumented |
Instance Variable | extra |
Undocumented |
Instance Variable | source |
Undocumented |
Method | _get |
Return a dict of extra __init__() options to include in the repr. |
Inherited from SQLiteNumericMixin
:
Method | as |
Undocumented |
Inherited from Expression
(via SQLiteNumericMixin
):
Method | __eq__ |
Undocumented |
Method | __hash__ |
Undocumented |
Property | identity |
Undocumented |
Inherited from BaseExpression
(via SQLiteNumericMixin
, Expression
):
Method | __getstate__ |
Undocumented |
Method | asc |
Undocumented |
Method | desc |
Undocumented |
Method | flatten |
Recursively yield this expression and all subexpressions, in depth-first order. |
Method | get |
Undocumented |
Method | get |
Undocumented |
Method | get |
Undocumented |
Method | get |
Return the underlying field types used by this aggregate. |
Method | get |
Undocumented |
Method | prefix |
Undocumented |
Method | relabeled |
Undocumented |
Method | replace |
Undocumented |
Method | reverse |
Undocumented |
Method | select |
Custom format for select clauses. For example, EXISTS expressions need to be wrapped in CASE WHEN on Oracle. |
Class Variable | filterable |
Undocumented |
Class Variable | is |
Undocumented |
Class Variable | window |
Undocumented |
Property | conditional |
Undocumented |
Property | contains |
Undocumented |
Property | contains |
Undocumented |
Property | contains |
Undocumented |
Property | convert |
Expressions provide their own converters because users have the option of manually specifying the output_field which may be a different type from the one the database returns. |
Property | field |
Undocumented |
Property | output |
Return the output type of this expressions. |
Static Method | _convert |
Undocumented |
Method | _parse |
Undocumented |
Method | _resolve |
Attempt to infer the output type of the expression. |
Class Variable | _output |
Undocumented |
Property | _output |
Return the output field of this expression, or None if _resolve_output_field() didn't return an output type. |
Inherited from Combinable
(via SQLiteNumericMixin
, Expression
, BaseExpression
):
Method | __add__ |
Undocumented |
Method | __and__ |
Undocumented |
Method | __mod__ |
Undocumented |
Method | __mul__ |
Undocumented |
Method | __neg__ |
Undocumented |
Method | __or__ |
Undocumented |
Method | __pow__ |
Undocumented |
Method | __radd__ |
Undocumented |
Method | __rand__ |
Undocumented |
Method | __rmod__ |
Undocumented |
Method | __rmul__ |
Undocumented |
Method | __ror__ |
Undocumented |
Method | __rpow__ |
Undocumented |
Method | __rsub__ |
Undocumented |
Method | __rtruediv__ |
Undocumented |
Method | __rxor__ |
Undocumented |
Method | __sub__ |
Undocumented |
Method | __truediv__ |
Undocumented |
Method | __xor__ |
Undocumented |
Method | bitand |
Undocumented |
Method | bitleftshift |
Undocumented |
Method | bitor |
Undocumented |
Method | bitrightshift |
Undocumented |
Method | bitxor |
Undocumented |
Constant | ADD |
Undocumented |
Constant | BITAND |
Undocumented |
Constant | BITLEFTSHIFT |
Undocumented |
Constant | BITOR |
Undocumented |
Constant | BITRIGHTSHIFT |
Undocumented |
Constant | BITXOR |
Undocumented |
Constant | DIV |
Undocumented |
Constant | MOD |
Undocumented |
Constant | MUL |
Undocumented |
Constant | POW |
Undocumented |
Constant | SUB |
Undocumented |
Method | _combine |
Undocumented |
django.db.models.aggregates.Aggregate
, django.db.models.expressions.ExpressionList
, django.db.models.expressions.OrderByList
, django.db.models.fields.json.KeyTransform
, django.db.models.functions.Cast
, django.db.models.functions.Coalesce
, django.db.models.functions.Collate
, django.db.models.functions.Concat
, django.db.models.functions.datetime.TruncBase
, django.db.models.functions.Extract
, django.db.models.functions.Greatest
, django.db.models.functions.JSONObject
, django.db.models.functions.Least
, django.db.models.functions.Left
, django.db.models.functions.LPad
, django.db.models.functions.Repeat
, django.db.models.functions.Replace
, django.db.models.functions.Round
, django.db.models.functions.Substr
, django.db.models.functions.window.LagLeadFunction
, django.db.models.functions.window.NthValue
, django.db.models.functions.window.Ntile
Undocumented
django.db.models.aggregates.Aggregate
, django.db.models.expressions.OrderByList
, django.db.models.functions.Cast
, django.db.models.functions.Collate
, django.db.models.functions.datetime.TruncBase
, django.db.models.functions.Extract
, django.db.models.functions.JSONObject
Responsible for returning a (sql, [params]) tuple to be included in the current query. Different backends can provide their own implementation, by providing an `as_{vendor}` method and patching the Expression: ``` def override_as_sql(self, compiler, connection): # custom logic return super().as_sql(compiler, connection) setattr(Expression, 'as_' + connection.vendor, override_as_sql) ``` Arguments: * compiler: the query compiler responsible for generating the query. Must have a compile method, returning a (sql, [params]) tuple. Calling compiler(value) will return a quoted `value`. * connection: the database connection used for the current query. Return: (sql, params) Where `sql` is a string containing ordered sql parameters to be replaced with the elements of the list `params`.
django.db.models.aggregates.Aggregate
, django.db.models.functions.datetime.TruncBase
, django.db.models.functions.Extract
, django.db.models.indexes.IndexExpression
Provide the chance to do any preprocessing or validation before being added to the query. Arguments: * query: the backend query implementation * allow_joins: boolean allowing or denying use of joins in this query * reuse: a set of reusable joins for multijoins * summarize: a terminal aggregate clause * for_save: whether this expression about to be used in a save or update Return: an Expression to be added to the query.
django.db.models.functions.ATan2
, django.db.models.functions.Left
, django.db.models.functions.Log
, django.db.models.functions.Mod
, django.db.models.functions.NullIf
, django.db.models.functions.Pi
, django.db.models.functions.Power
, django.db.models.functions.Random
, django.db.models.functions.StrIndex
, django.db.models.functions.window.FirstValue
, django.db.models.functions.window.LastValue
, django.db.models.lookups.Transform
Undocumented
django.contrib.postgres.fields.ranges.IsEmpty
, django.contrib.postgres.fields.ranges.LowerInclusive
, django.contrib.postgres.fields.ranges.LowerInfinite
, django.contrib.postgres.fields.ranges.RangeEndsWith
, django.contrib.postgres.fields.ranges.RangeStartsWith
, django.contrib.postgres.fields.ranges.UpperInclusive
, django.contrib.postgres.fields.ranges.UpperInfinite
, django.db.models.aggregates.Avg
, django.db.models.aggregates.Count
, django.db.models.aggregates.Max
, django.db.models.aggregates.Min
, django.db.models.aggregates.StdDev
, django.db.models.aggregates.Sum
, django.db.models.aggregates.Variance
, django.db.models.functions.Abs
, django.db.models.functions.ACos
, django.db.models.functions.ASin
, django.db.models.functions.ATan
, django.db.models.functions.ATan2
, django.db.models.functions.Cast
, django.db.models.functions.Ceil
, django.db.models.functions.Chr
, django.db.models.functions.Coalesce
, django.db.models.functions.Collate
, django.db.models.functions.Concat
, django.db.models.functions.ConcatPair
, django.db.models.functions.Cos
, django.db.models.functions.Cot
, django.db.models.functions.Degrees
, django.db.models.functions.Exp
, django.db.models.functions.Floor
, django.db.models.functions.Greatest
, django.db.models.functions.JSONObject
, django.db.models.functions.Least
, django.db.models.functions.Left
, django.db.models.functions.Length
, django.db.models.functions.Ln
, django.db.models.functions.Log
, django.db.models.functions.Lower
, django.db.models.functions.LPad
, django.db.models.functions.LTrim
, django.db.models.functions.MD5
, django.db.models.functions.Mod
, django.db.models.functions.NullIf
, django.db.models.functions.Ord
, django.db.models.functions.Pi
, django.db.models.functions.Power
, django.db.models.functions.Radians
, django.db.models.functions.Random
, django.db.models.functions.Repeat
, django.db.models.functions.Replace
, django.db.models.functions.Reverse
, django.db.models.functions.Round
, django.db.models.functions.RTrim
, django.db.models.functions.SHA1
, django.db.models.functions.SHA224
, django.db.models.functions.SHA256
, django.db.models.functions.SHA384
, django.db.models.functions.SHA512
, django.db.models.functions.Sign
, django.db.models.functions.Sin
, django.db.models.functions.Sqrt
, django.db.models.functions.StrIndex
, django.db.models.functions.Substr
, django.db.models.functions.Tan
, django.db.models.functions.Trim
, django.db.models.functions.Upper
, django.db.models.functions.window.CumeDist
, django.db.models.functions.window.DenseRank
, django.db.models.functions.window.FirstValue
, django.db.models.functions.window.Lag
, django.db.models.functions.window.LastValue
, django.db.models.functions.window.Lead
, django.db.models.functions.window.NthValue
, django.db.models.functions.window.Ntile
, django.db.models.functions.window.PercentRank
, django.db.models.functions.window.Rank
, django.db.models.functions.window.RowNumber
Undocumented
django.db.models.aggregates.Aggregate
, django.db.models.expressions.ExpressionList
, django.db.models.expressions.OrderByList
, django.db.models.functions.Cast
, django.db.models.functions.Collate
, django.db.models.functions.Concat
, django.db.models.functions.Now
, django.db.models.indexes.IndexExpression
Undocumented
django.db.models.aggregates.Aggregate
Return a dict of extra __init__() options to include in the repr.