4 from django.core.management import setup_environ
5 from wolnelektury import settings
9 from set import Set as set
11 setup_environ(settings)
13 from catalogue import models
15 fragment_identifiers = set()
18 print 'Before: %d fragments' % models.Fragment.objects.count()
21 for fragment in models.Fragment.objects.all():
22 if (fragment.book_id, fragment.anchor) in fragment_identifiers:
26 fragment_identifiers.add((fragment.book_id, fragment.anchor))
30 print 'After: %d fragments' % models.Fragment.objects.count()