find exact titles

This commit is contained in:
j 2011-08-25 17:17:07 +02:00
parent 00ad8652ea
commit 2b43fbd35a
2 changed files with 4 additions and 2 deletions

View file

@ -61,7 +61,7 @@ def parseCondition(condition):
if key_type == "string": if key_type == "string":
in_find=True in_find=True
value_key = 'find__value' value_key = 'find__value'
if k in models.Item.facet_keys: if k in models.Item.facet_keys + ['title']:
in_find = False in_find = False
if op == '=' or op == '^$': if op == '=' or op == '^$':
v = models.Item.objects.filter(facets__key=k, facets__value=v) v = models.Item.objects.filter(facets__key=k, facets__value=v)

View file

@ -657,8 +657,10 @@ class Item(models.Model):
def update_facets(self): def update_facets(self):
#FIXME: what to do with Unkown Director, Year, Country etc. #FIXME: what to do with Unkown Director, Year, Country etc.
for key in self.facet_keys: for key in self.facet_keys + ['title']:
current_values = self.get(key, []) current_values = self.get(key, [])
if key == 'title':
current_values += self.get('original_title', [])
#FIXME: is there a better way to build name collection? #FIXME: is there a better way to build name collection?
if key == 'name': if key == 'name':
current_values = [] current_values = []