Created
May 14, 2013 06:53
-
-
Save marcelor/5574155 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 apps.polidata.models import Politician | |
twitter_data = { | |
"00512": "@PepeSolari", | |
"00405": "@JAIMETROBO", | |
"05851": "@AlfredoAsti", | |
"00161": "@JuanRaFerreira", | |
"05262": "@dpayss1", | |
"05137": "@juliocesilveira", | |
"00197": "@Luisaheber", | |
"01044": "@jgamorin", | |
} | |
for profile_id,twitter_user in twitter_data.items(): | |
try: | |
politician = Politician.objects.get(profile_id=profile_id) | |
politician.twitter_user = twitter_user | |
politician.save() | |
print 'Updated twitter user %s of %s' % (twitter_user, politician) | |
except Politician.DoesNotExist: | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment