db.models.Q

class Q [source]

A Q() object, like an F object, encapsulates a SQL expression in a Python object that can be used in database-related operations.

In general, Q() objects make it possible to define and reuse conditions. This permits the construction of complex database queries using | (OR) and & (AND) operators; in particular, it is not otherwise possible to use OR in QuerySets.

doc_Django
2016-10-09 18:36:03
Comments
Leave a Comment

Please login to continue.