Skip to content

Instantly share code, notes, and snippets.

@ryszard
Created January 5, 2010 17:35
Show Gist options
  • Save ryszard/269545 to your computer and use it in GitHub Desktop.
Save ryszard/269545 to your computer and use it in GitHub Desktop.
In [1]: from petitions.models import *
In [4]: sum(p.signature_set.count() for p in Petition.objects.all())
Out[4]: 1722
In [5]: sum(p.signature_set.count() for p in Petition.objects.all())
Out[5]: 1722
In [6]: from django.db import connection, transaction
In [7]: cursor = connection.cursor()
In [8]: cursor.execute("select count(*) from petitions_blipuser_signed_petitions")
In [9]: signed = cursor.fetchone()
In [10]: signed
Out[10]: (1096L,)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment