Skip to content

Instantly share code, notes, and snippets.

@gpennington
Last active January 4, 2016 20:49
Show Gist options
  • Save gpennington/8676650 to your computer and use it in GitHub Desktop.
Save gpennington/8676650 to your computer and use it in GitHub Desktop.
Pulse Area/Users
#webserver
(activate virtualenv first)
python manage.py shell --settings=settings.production
#python console
>>> from django.contrib.auth.models import User
>>> from meta.models import Area
>>> janelle = User.objects.get(pk=2)
>>> hodgins2 = User.objects.get(pk=54)
>>> Area.objects.exclude(owners=None).count()
566
>>> Area.objects.exclude(owners__in=[janelle, hodgins2]).count()
310
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment