find clipQuery

This commit is contained in:
j 2011-10-19 17:55:29 +02:00
commit 898aa66509
3 changed files with 32 additions and 15 deletions

View file

@ -79,8 +79,11 @@ class Clip(models.Model):
public_layers = [l['id']
for l in filter(lambda l: not l.get('private', False),
settings.CONFIG['layers'])]
if 'annotations' in keys:
j['annotations'] = [a.json(keys=['value', 'id', 'layer'])
for a in self.annotations.filter(layer__name__in=public_layers).select_related()]
for layer in filter(lambda l: l in keys, public_layers):
j[layer] = [a.json(keys=['value'])['value']
j[layer] = [a.json(keys=['id', 'value'])
for a in self.annotations.filter(layer__name=layer)]
for key in keys:
if key not in clip_keys and key not in j: