git-svn-id: svn://svn.open-ils.org/ILS-Contrib/servres/trunk@90 6d9bc8c9-1ec2-4278...
authorartunit <artunit@6d9bc8c9-1ec2-4278-b937-99fde70a366f>
Fri, 2 Jan 2009 22:03:23 +0000 (22:03 +0000)
committerartunit <artunit@6d9bc8c9-1ec2-4278-b937-99fde70a366f>
Fri, 2 Jan 2009 22:03:23 +0000 (22:03 +0000)
conifer/syrup/models.py
conifer/syrup/views.py

index 6953894..95e99fa 100644 (file)
@@ -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):
index c8668c3..9d972bb 100644 (file)
@@ -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