ignore empty annotations in find
This commit is contained in:
parent
81cef44d19
commit
aaa6981a54
1 changed files with 2 additions and 2 deletions
|
@ -603,11 +603,11 @@ class Item(models.Model):
|
||||||
save(i, self.user.username)
|
save(i, self.user.username)
|
||||||
elif key['id'] == 'annotations':
|
elif key['id'] == 'annotations':
|
||||||
qs = Annotation.objects.filter(item=self)
|
qs = Annotation.objects.filter(item=self)
|
||||||
qs = qs.filter(layer__in=Annotation.public_layers())
|
qs = qs.filter(layer__in=Annotation.public_layers()).exclude(findvalue=None)
|
||||||
qs = qs.order_by('start')
|
qs = qs.order_by('start')
|
||||||
save(i, u'\n'.join([l.findvalue for l in qs]))
|
save(i, u'\n'.join([l.findvalue for l in qs]))
|
||||||
elif key['type'] == 'layer':
|
elif key['type'] == 'layer':
|
||||||
qs = Annotation.objects.filter(item=self)
|
qs = Annotation.objects.filter(item=self).exclude(findvalue=None)
|
||||||
qs = qs.filter(layer=i)
|
qs = qs.filter(layer=i)
|
||||||
qs = qs.order_by('start')
|
qs = qs.order_by('start')
|
||||||
save(i, u'\n'.join(filter(None, [l.findvalue for l in qs])))
|
save(i, u'\n'.join(filter(None, [l.findvalue for l in qs])))
|
||||||
|
|
Loading…
Reference in a new issue