From 5649892bbd87cf78ef78624941eac1befefac905 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sun, 4 Oct 2015 11:20:45 +0200 Subject: [PATCH] annotation layer flag is boolean --- pandora/clip/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora/clip/models.py b/pandora/clip/models.py index ebb00989..bd6dab61 100644 --- a/pandora/clip/models.py +++ b/pandora/clip/models.py @@ -88,7 +88,7 @@ class MetaClip: self.findvalue = '\n'.join(filter(None, [a.findvalue for a in anns])) for l in [k['id'] for k in settings.CONFIG['layers']]: - setattr(self, l, len(anns_by_layer[l]) if l in anns_by_layer else 0) + setattr(self, l, l in anns_by_layer and len(anns_by_layer[l])) models.Model.save(self, *args, **kwargs) clip_keys = ('id', 'in', 'out', 'position', 'created', 'modified', @@ -199,7 +199,7 @@ attrs = { 'end': models.FloatField(default=-1), 'duration': models.FloatField(default=0, db_index=True), - + #get from annotation 'hue': models.FloatField(default=0, db_index=True), 'saturation': models.FloatField(default=0, db_index=True),