remove layer of indirection
This commit is contained in:
parent
7c37c1efde
commit
df9fc699ff
7 changed files with 17 additions and 81 deletions
|
|
@ -41,7 +41,7 @@ def parseCondition(condition, user):
|
|||
return parseCondition({'key': 'annotations__value',
|
||||
'value': v,
|
||||
'operator': op}, user) \
|
||||
& parseCondition({'key': 'annotations__layer__name',
|
||||
& parseCondition({'key': 'annotations__layer',
|
||||
'value': k,
|
||||
'operator': '=='}, user)
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ class MetaClip:
|
|||
if streams:
|
||||
self.aspect_ratio = streams[0].aspect_ratio
|
||||
for l in self.layers:
|
||||
setattr(self, l, self.annotations.filter(layer__name=l).count()>0)
|
||||
setattr(self, l, self.annotations.filter(layer=l).count()>0)
|
||||
models.Model.save(self, *args, **kwargs)
|
||||
|
||||
def json(self, keys=None):
|
||||
|
|
|
|||
|
|
@ -105,10 +105,10 @@ def findClips(request):
|
|||
if response['data']['items']:
|
||||
if 'annotations' in keys:
|
||||
add_annotations('annotations',
|
||||
Annotation.objects.filter(layer__name__in=models.Clip.layers, clip__in=ids))
|
||||
Annotation.objects.filter(layer__in=models.Clip.layers, clip__in=ids))
|
||||
for layer in filter(lambda l: l in keys, models.Clip.layers):
|
||||
add_annotations(layer,
|
||||
Annotation.objects.filter(layer__name=layer, clip__in=ids))
|
||||
Annotation.objects.filter(layer=layer, clip__in=ids))
|
||||
elif 'position' in query:
|
||||
qs = order_query(qs, query['sort'])
|
||||
ids = [i.public_id for i in qs]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue