Example #1
0
 def __init__(self, status, field, term, user_sph_map={}):
     self.status = status
     self.term = utils.strips(term)
     field = field.strip().lower()
     self.user_field = utils.dictreverse(user_sph_map).get(field,
                                                           field).lower()
     self.sph_field = user_sph_map.get(field, field).lower()
Example #2
0
 def sphinx(self):
     """The string representation of this query which should be sent to sphinx.
     """
     s = utils.strips(' '.join(qt.sphinx for qt in self))
     if not s and not self.ALLOW_EMPTY:
         s = ' '
     return s
Example #3
0
 def sphinx(self):
     """The string representation of this query which should be sent to sphinx.
     """
     s = utils.strips(' '.join(qt.sphinx for qt in self))
     if not s and not self.ALLOW_EMPTY:
         s = ' '
     return s
Example #4
0
 def uniq(self):
     """A canonical / unique string representation of this query.
     """
     return utils.strips(' '.join(qt.uniq for qt in sorted(self)))
Example #5
0
 def uniq(self):
     """A canonical / unique string representation of this query.
     
     SQLCache will look for this variable when caching the query results.
     """
     return utils.strips(' '.join(qt.uniq for qt in sorted(self)))
Example #6
0
 def __init__(self, status, field, term, user_sph_map={}):
     self.status = status
     self.term = utils.strips(term)
     field = field.strip().lower()
     self.user_field = utils.dictreverse(user_sph_map).get(field, field).lower()
     self.sph_field = user_sph_map.get(field, field).lower()
Example #7
0
 def uniq(self):
     """A canonical / unique string representation of this query.
     """
     return utils.strips(' '.join(qt.uniq for qt in sorted(self)))
Example #8
0
 def uniq(self):
     """A canonical / unique string representation of this query.
     
     SQLCache will look for this variable when caching the query results.
     """
     return utils.strips(' '.join(qt.uniq for qt in sorted(self)))