forked from 0x2620/pandora
more find keys
This commit is contained in:
parent
656c4f7201
commit
8dca4cb676
1 changed files with 17 additions and 16 deletions
|
@ -511,22 +511,23 @@ class Item(models.Model):
|
||||||
ItemFind.objects.filter(item=self, key=key).delete()
|
ItemFind.objects.filter(item=self, key=key).delete()
|
||||||
|
|
||||||
for key in settings.CONFIG['itemKeys']:
|
for key in settings.CONFIG['itemKeys']:
|
||||||
if key.get('find'):
|
i = key['id']
|
||||||
i = key['id']
|
if i == 'title':
|
||||||
if i == 'title':
|
save(i, u'\n'.join([self.get('title', 'Untitled'),
|
||||||
save(i, u'\n'.join([self.get('title', 'Untitled'),
|
self.get('originalTitle', '')]))
|
||||||
self.get('originalTitle', '')]))
|
elif i == 'rightslevel':
|
||||||
elif i == 'filename':
|
save(i, self.level)
|
||||||
save(i,
|
elif i == 'filename':
|
||||||
'\n'.join([f.path for f in self.files.all()]))
|
save(i,
|
||||||
elif key['type'] == 'layer':
|
'\n'.join([f.path for f in self.files.all()]))
|
||||||
qs = Annotation.objects.filter(layer__name=i, item=self).order_by('start')
|
elif key['type'] == 'layer':
|
||||||
save(i, '\n'.join([l.value for l in qs]))
|
qs = Annotation.objects.filter(layer__name=i, item=self).order_by('start')
|
||||||
elif i != '*' and i not in self.facet_keys:
|
save(i, '\n'.join([l.value for l in qs]))
|
||||||
value = self.get(i)
|
elif i != '*' and i not in self.facet_keys:
|
||||||
if isinstance(value, list):
|
value = self.get(i)
|
||||||
value = u'\n'.join(value)
|
if isinstance(value, list):
|
||||||
save(i, value)
|
value = u'\n'.join(value)
|
||||||
|
save(i, value)
|
||||||
|
|
||||||
for key in self.facet_keys:
|
for key in self.facet_keys:
|
||||||
if key == 'character':
|
if key == 'character':
|
||||||
|
|
Loading…
Reference in a new issue