class Count(expression, distinct=False, **extra) [source]
Returns the number of objects that are related through the provided expression.
- Default alias:
<field>__count - Return type:
int
Has one optional argument:
-
distinct -
If
distinct=True, the count will only include unique instances. This is the SQL equivalent ofCOUNT(DISTINCT <field>). The default value isFalse.
Please login to continue.