remove duplicate editions

pull/1/head
Ed Summers 2011-12-20 12:37:50 -05:00
parent 19976b2520
commit 9231923b88
1 changed files with 5 additions and 2 deletions

View File

@ -12,5 +12,8 @@ class Command(BaseCommand):
for r in q:
if r['googlebooks_id__count'] == 1:
continue
print r['googlebooks_id']
gb = r['googlebooks_id']
editions = models.Edition.objects.filter(googlebooks_id=gb)
for e in editions[1:]:
print "removing duplicate edition: %s" % e
e.delete()