rename Item.itemId to Item.public_id

This commit is contained in:
j 2014-09-19 12:26:46 +00:00
commit 3232ce6989
44 changed files with 382 additions and 213 deletions

View file

@ -13,7 +13,7 @@ class Command(BaseCommand):
def handle(self, id, height, position, **options):
position = float(position)
i = models.Item.objects.get(itemId=id)
i = models.Item.objects.get(public_id=id)
path = i.frame(position, height)
if path:
print path

View file

@ -25,6 +25,6 @@ class Command(BaseCommand):
for i in models.Item.objects.all().order_by('id')[offset:offset+chunk]:
if not os.path.exists(os.path.join(i.timeline_prefix, 'cuts.json')) or \
not glob('%s/timelinekeyframes16p0.jpg'%i.timeline_prefix):
print i.itemId
tasks.rebuild_timeline.delay(i.itemId)
print i.public_id
tasks.rebuild_timeline.delay(i.public_id)
offset += chunk

View file

@ -22,7 +22,7 @@ class Command(BaseCommand):
count = pos = models.Item.objects.count()
while offset <= count:
for i in models.Item.objects.all().order_by('id')[offset:offset+chunk]:
print pos, i.itemId
print pos, i.public_id
i.save()
time.sleep(1) #dont overload db
pos -= 1

View file

@ -24,12 +24,12 @@ class Command(BaseCommand):
def handle(self, **options):
offset = 0
chunk = options['all'] and 100 or options['items']
qs = models.Item.objects.exclude(itemId__startswith='0x')
qs = models.Item.objects.exclude(public_id__startswith='0x')
count = pos = qs.count()
while (options['all'] and offset <= count) or offset < options['items']:
print offset, pos, count
for i in qs.order_by('modified')[:chunk]:
print pos, i.itemId, i.modified
print pos, i.public_id, i.modified
i.update_external()
pos -= 1
offset += chunk