1
0
mirror of https://github.com/django/django.git synced 2025-06-06 20:19:13 +00:00

[2.0.x] Fixed import in docs/ref/models/conditional-expressions.txt example.

Backport of 9d1d0e2b702fe1a3f979a95bc4583f1a1691c74f from master
This commit is contained in:
Mohammad Esmaeilbeygi 2017-12-07 17:27:38 +03:30 committed by Tim Graham
parent a2aea4521d
commit 6b01ff80b2

View File

@ -207,7 +207,7 @@ functions <aggregation-functions>` to achieve this::
... account_type=Client.PLATINUM, ... account_type=Client.PLATINUM,
... registered_on=date.today()) ... registered_on=date.today())
>>> # Get counts for each value of account_type >>> # Get counts for each value of account_type
>>> from django.db.models import IntegerField, Sum >>> from django.db.models import Count
>>> Client.objects.aggregate( >>> Client.objects.aggregate(
... regular=Count('pk', filter=Q(account_type=Client.REGULAR)), ... regular=Count('pk', filter=Q(account_type=Client.REGULAR)),
... gold=Count('pk', filter=Q(account_type=Client.GOLD)), ... gold=Count('pk', filter=Q(account_type=Client.GOLD)),