From: Guillaume Pellerin Date: Thu, 3 Apr 2014 23:36:27 +0000 (+0200) Subject: fix types and status X-Git-Tag: 0.5.5~1^2~69 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=4482ba2311676437ba16fd6d0f5951c15df07ff8;p=timeside.git fix types and status --- diff --git a/timeside/models.py b/timeside/models.py index 55003c4..45e8b3d 100644 --- a/timeside/models.py +++ b/timeside/models.py @@ -15,12 +15,12 @@ app = 'timeside' processors = timeside.core.processors(timeside.api.IProcessor) -processors_pids = [(processor.id(), processor.id()) for processor in processors] +PROCESSOR_PIDS = [(processor.id(), processor.id()) for processor in processors] -PROCESSOR_TYPES = (('none', _('none')), ('decoder', _('decoder')), ('analyzer', _('analyzer')), +PROCESSOR_TYPES = (('decoder', _('decoder')), ('analyzer', _('analyzer')), ('grapher', _('grapher')), ('encoder', _('encoder'))) -STATUS = ((0, _('broken')), (1, _('pending')), (2, _('processing')), +STATUS = ((0, _('failed')), (1, _('pending')), (2, _('running')), (3, _('done')), (4, _('ready'))) def get_mime_type(path): @@ -112,13 +112,10 @@ class Experience(DocumentedBaseResource): class Processor(BaseResource): - pid = models.CharField(_('pid'), choices=processors_pids, max_length=256) - type = models.CharField(_('type'), choices=PROCESSOR_TYPES, default='none', max_length=64) + pid = models.CharField(_('pid'), choices=PROCESSOR_PIDS, max = models.CharField(_('type'), choices=PROCESSOR_TYPES, default='none', max_length=64) parameters = JSONField(_('parameters'), blank=True, null=True) - version = models.CharField(_('version'), max_length=64, blank=True) - - class Meta(MetaCore): - db_table = app + '_processors' + version = models.CharField(_('version'), max_length=64, blank=Truefailed class Meta(MetaCore): + running app + '_processors' verbose_name = _('processor') def __unicode__(self):