get frame via manage.py so it also works for private items
This commit is contained in:
parent
c891601cf5
commit
959479457d
3 changed files with 66 additions and 26 deletions
16
pandora/item/management/commands/get_frame.py
Normal file
16
pandora/item/management/commands/get_frame.py
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# vi:si:et:sw=4:sts=4:ts=4
|
||||
from django.core.management.base import BaseCommand
|
||||
|
||||
import app.monkey_patch
|
||||
from ... import models
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = 'extract frame and print path'
|
||||
args = '<id> <height> <position>'
|
||||
|
||||
def handle(self, id, height, position, **options):
|
||||
position = float(position)
|
||||
i = models.Item.objects.get(itemId=id)
|
||||
path = i.frame(position, height)
|
||||
print path
|
||||
Loading…
Add table
Add a link
Reference in a new issue