Created
October 23, 2013 08:02
-
-
Save vanatteveldt/7114409 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 amcat.models import Article | |
import csv, sys | |
for line in csv.DictReader(sys.stdin, delimiter=';'): | |
aid = int(line["Article ID"]) | |
mid = int(line["New Medium ID"]) | |
print aid, "->", mid | |
a = Article.objects.get(pk=aid) | |
a.medium_id = mid | |
a.save() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment