1👍
✅
group_object.contact_set.count()
should do it. Django creates the relation by adding _set
to the end of the foreign key’s model name.
Have a look at the docs on related objects for more info.
Source:stackexchange.com