#!/usr/bin/env python
from django.db.models import Count
from .models import MyModel

"""
https://docs.djangoproject.com/en/dev/ref/models/querysets/#annotate

annotate(*args, **kwargs)
"""

qs = MyModel.objects.annotate(column_name=Count('id'))
print(q[0].column_name)

8c0c3ac2824815017a79e50c78c1eb40c53dd28a
<mask token>

<mask token>
print(q[0].column_name)

<mask token>
qs = MyModel.objects.annotate(column_name=Count('id'))
print(q[0].column_name)

from django.db.models import Count
from .models import MyModel
<mask token>
qs = MyModel.objects.annotate(column_name=Count('id'))
print(q[0].column_name)

#!/usr/bin/env python
from django.db.models import Count
from .models import MyModel

"""
https://docs.djangoproject.com/en/dev/ref/models/querysets/#annotate

annotate(*args, **kwargs)
"""

qs = MyModel.objects.annotate(column_name=Count('id'))
print(q[0].column_name)
