Skip to content

Instantly share code, notes, and snippets.

@bikeath1337
Created April 16, 2014 14:47
Show Gist options
  • Save bikeath1337/10887747 to your computer and use it in GitHub Desktop.
Save bikeath1337/10887747 to your computer and use it in GitHub Desktop.
Tutor count Per Organization
from dbor_schemas.models import NoodleTutoringOrganization
from django.db.models import Count
to = NoodleTutoringOrganization.objects.annotate(Count('primary_profile'))
for tutor_org in to:
print tutor_org.name, "tutors", tutor_org.primary_profile__count
@jvzammit
Copy link

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment