Created
December 18, 2010 02:41
-
-
Save matthewryanscott/746071 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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