1👍
✅
To get the count of branch records associated with a store, you should query the Branch
model instead. Since reverse m2m queries are supported, you can simply do:
branch_count = Branch.objects.filter(store=store_obj).count()
Source:stackexchange.com