Skip to content

Instantly share code, notes, and snippets.

@matthewryanscott
Created December 18, 2010 02:41
Show Gist options
  • Save matthewryanscott/746071 to your computer and use it in GitHub Desktop.
Save matthewryanscott/746071 to your computer and use it in GitHub Desktop.
from teams.models import Team
from zipcodes.models import ZipCode, County
Z = list(ZipCode.objects.all())
for team in Team.objects.all():
for zip_code in team.zip_codes.all():
if zip_code in Z:
Z.remove(zip_code)
for county in team.counties.all():
for zip_code in county.zip_codes():
if zip_code in Z:
Z.remove(zip_code)
import pprint
pprint.pprint(Z)
print len(Z)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment