Skip to content

Instantly share code, notes, and snippets.

@mbeale
Created December 11, 2012 21:18
Show Gist options
  • Save mbeale/4262206 to your computer and use it in GitHub Desktop.
Save mbeale/4262206 to your computer and use it in GitHub Desktop.
Sample code change
Turns this:
accounts = Account.all()
while accounts:
for account in accounts:
print 'Account: %s' % account
try:
accounts = accounts.next_page()
except PageError:
accounts = ()
into this:
for account in Account.all():
print 'Account: %s' % account
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment