From 8dca4cb67652b36f06ac4a4015932fb00a89b6f5 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 25 Oct 2011 17:04:55 +0200 Subject: [PATCH] more find keys --- pandora/item/models.py | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/pandora/item/models.py b/pandora/item/models.py index 5de4b8aae..ef22e747f 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -511,22 +511,23 @@ class Item(models.Model): ItemFind.objects.filter(item=self, key=key).delete() for key in settings.CONFIG['itemKeys']: - if key.get('find'): - i = key['id'] - if i == 'title': - save(i, u'\n'.join([self.get('title', 'Untitled'), - self.get('originalTitle', '')])) - elif i == 'filename': - save(i, - '\n'.join([f.path for f in self.files.all()])) - elif key['type'] == 'layer': - qs = Annotation.objects.filter(layer__name=i, item=self).order_by('start') - save(i, '\n'.join([l.value for l in qs])) - elif i != '*' and i not in self.facet_keys: - value = self.get(i) - if isinstance(value, list): - value = u'\n'.join(value) - save(i, value) + i = key['id'] + if i == 'title': + save(i, u'\n'.join([self.get('title', 'Untitled'), + self.get('originalTitle', '')])) + elif i == 'rightslevel': + save(i, self.level) + elif i == 'filename': + save(i, + '\n'.join([f.path for f in self.files.all()])) + elif key['type'] == 'layer': + qs = Annotation.objects.filter(layer__name=i, item=self).order_by('start') + save(i, '\n'.join([l.value for l in qs])) + elif i != '*' and i not in self.facet_keys: + value = self.get(i) + if isinstance(value, list): + value = u'\n'.join(value) + save(i, value) for key in self.facet_keys: if key == 'character':