From: artunit Date: Fri, 2 Jan 2009 22:03:23 +0000 (+0000) Subject: git-svn-id: svn://svn.open-ils.org/ILS-Contrib/servres/trunk@90 6d9bc8c9-1ec2-4278... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=01387759ea80e727f5c6afec460f4031245f93f4;p=syrup%2Fmasslnc.git git-svn-id: svn://svn.open-ils.org/ILS-Contrib/servres/trunk@90 6d9bc8c9-1ec2-4278-b937-99fde70a366f --- diff --git a/conifer/syrup/models.py b/conifer/syrup/models.py index 6953894..95e99fa 100644 --- a/conifer/syrup/models.py +++ b/conifer/syrup/models.py @@ -178,12 +178,11 @@ class Member(m.Model): max_length = 5) def instr_name_hl(self, terms): + hl_instr = self.user.last_name for term in terms: - hl_instr = highlight(self.user.last_name,term) - if not hl_instr == self.user.last_name: - return hl_instr + hl_instr = highlight(hl_instr,term) - return self.user.last_name + return hl_instr def instr_name(self): return self.user.last_name @@ -288,20 +287,19 @@ class Item(m.Model): last_modified = m.DateTimeField() def title_hl(self, terms): + hl_title = self.title for term in terms: - hl_title = highlight(self.title,term) - if not hl_title == self.title: - return hl_title + hl_title = highlight(hl_title,term) - return self.title + return hl_title def author_hl(self, terms): + hl_author = self.author + for term in terms: - hl_author = highlight(self.author,term) - if not hl_author == self.author: - return hl_author + hl_author = highlight(hl_author,term) - return self.author + return hl_author def __unicode__(self): diff --git a/conifer/syrup/views.py b/conifer/syrup/views.py index c8668c3..9d972bb 100644 --- a/conifer/syrup/views.py +++ b/conifer/syrup/views.py @@ -168,7 +168,6 @@ def search(request): query_string = request.GET['q'].strip() if len(query_string) > 0: - print len(query_string) norm_query = normalize_query(query_string) #item search - this will be expanded