db.models.Expression.resolve_expression()

resolve_expression(query=None, allow_joins=True, reuse=None, summarize=False, for_save=False) Provides the chance to do any pre-processing or validation of the expression before it’s added to the query. resolve_expression() must also be called on any nested expressions. A copy() of self should be returned with any necessary transformations. query is the backend query implementation. allow_joins is a boolean that allows or denies the use of joins in the query. reuse is a set of reusable joins

db.models.Expression.relabeled_clone()

relabeled_clone(change_map) Returns a clone (copy) of self, with any column aliases relabeled. Column aliases are renamed when subqueries are created. relabeled_clone() should also be called on any nested expressions and assigned to the clone. change_map is a dictionary mapping old aliases to new aliases. Example: def relabeled_clone(self, change_map): clone = copy.copy(self) clone.expression = self.expression.relabeled_clone(change_map) return clone

db.models.Expression.get_source_expressions()

get_source_expressions() Returns an ordered list of inner expressions. For example: >>> Sum(F('foo')).get_source_expressions() [F('foo')]

db.models.Expression.get_group_by_cols()

get_group_by_cols() Responsible for returning the list of columns references by this expression. get_group_by_cols() should be called on any nested expressions. F() objects, in particular, hold a reference to a column.

db.models.Expression.desc()

desc() Returns the expression ready to be sorted in descending order.

db.models.Expression.convert_value()

convert_value(self, value, expression, connection, context) A hook allowing the expression to coerce value into a more appropriate type.

db.models.Expression.contains_aggregate

contains_aggregate Tells Django that this expression contains an aggregate and that a GROUP BY clause needs to be added to the query.

db.models.Expression.asc()

asc() Returns the expression ready to be sorted in ascending order.

db.models.Expression

class Expression [source] contains_aggregate Tells Django that this expression contains an aggregate and that a GROUP BY clause needs to be added to the query. resolve_expression(query=None, allow_joins=True, reuse=None, summarize=False, for_save=False) Provides the chance to do any pre-processing or validation of the expression before it’s added to the query. resolve_expression() must also be called on any nested expressions. A copy() of self should be returned with any necessary t

db.models.EmailField

class EmailField(max_length=254, **options) [source] A CharField that checks that the value is a valid email address. It uses EmailValidator to validate the input.