djdb/search.py
def _get_matches(self, entity_kind, field, term, key=None):
        """Returns a cached SearchMatches object for a given kind and term."""
        _key = (entity_kind, field, term)
        sm = self._matches.get(_key)
        if sm is None:
            if key:
                q = models.SearchMatches.all()
                q.filter("entity_kind =", entity_kind)
                q.filter("field =", field)
                q.filter("term =", term)
                q.filter("matches =", key)
                sms = q.fetch(1)
                if sms :
                    sm = sms[0]
            if sm is None:
                sm = models.SearchMatches(generation=_GENERATION,
                                          entity_kind=entity_kind,
                                          field=field,
                                          term=term,
                                          parent=self.transaction)
            self._matches[_key] = sm
        return sm
Returns a cached SearchMatches object for a given kind and term.
Returns a cached SearchMatches object for a given kind and term.
Returns a cached SearchMatches object for a given kind and term .
def _get_matches(self, entity_kind, field, term, key=None):
        _key = (entity_kind, field, term)
        sm = self._matches.get(_key)
        if sm is None:
            if key:
                q = models.SearchMatches.all()
                q.filter("entity_kind =", entity_kind)
                q.filter("field =", field)
                q.filter("term =", term)
                q.filter("matches =", key)
                sms = q.fetch(1)
                if sms :
                    sm = sms[0]
            if sm is None:
                sm = models.SearchMatches(generation=_GENERATION,
                                          entity_kind=entity_kind,
                                          field=field,
                                          term=term,
                                          parent=self.transaction)
            self._matches[_key] = sm
        return sm
def _get_matches ( self , entity_kind , field , term , key = None ) : _key = ( entity_kind , field , term ) sm = self . _matches . get ( _key ) if sm is None : if key : q = models . SearchMatches . all ( ) q . filter ( "entity_kind =" , entity_kind ) q . filter ( "field =" , field ) q . filter ( "term =" , term ) q . filter ( "matches =" , key ) sms = q . fetch ( 1 ) if sms : sm = sms [ 0 ] if sm is None : sm = models . SearchMatches ( generation = _GENERATION , entity_kind = entity_kind , field = field , term = term , parent = self . transaction ) self . _matches [ _key ] = sm return sm
Returns a cached SearchMatches object for a given kind and term.
Returns a cached SearchMatches object for a given kind and term .
"""Returns a cached SearchMatches object for a given kind and term."""
self
entity_kind
field
term
key