djdb/search.py
def fetch_keys_for_one_prefix(term_prefix, entity_kind=None, field=None):
    """Find entity keys matching a single search term prefix.

    Args:
      term: A unicode string containing a single search term.
      entity_kind: An optional string.  If given, the returned keys are
        restricted to entities of that kind.
      field: An optional string.  If given, the returned keys are restricted
        to matches for that particular field.

    Returns:
      A set of (db.Key, matching field) pairs.
    """
    query = models.SearchMatches.all()
    if entity_kind:
        query.filter("entity_kind =", entity_kind)
    if field:
        query.filter("field =", field)
    query.filter("term >=", term_prefix)
    query.filter("term <", term_prefix + u"\uffff")
    return _fetch_all(query)
Find entity keys matching a single search term prefix.

    Args:
      term: A unicode string containing a single search term.
      entity_kind: An optional string.  If given, the returned keys are
        restricted to entities of that kind.
      field: An optional string.  If given, the returned keys are restricted
        to matches for that particular field.

    Returns:
      A set of (db.Key, matching field) pairs.
    
Find entity keys matching a single search term prefix.
Find entity keys matching a single search term prefix .
def fetch_keys_for_one_prefix(term_prefix, entity_kind=None, field=None):
    query = models.SearchMatches.all()
    if entity_kind:
        query.filter("entity_kind =", entity_kind)
    if field:
        query.filter("field =", field)
    query.filter("term >=", term_prefix)
    query.filter("term <", term_prefix + u"\uffff")
    return _fetch_all(query)
def fetch_keys_for_one_prefix ( term_prefix , entity_kind = None , field = None ) : query = models . SearchMatches . all ( ) if entity_kind : query . filter ( "entity_kind =" , entity_kind ) if field : query . filter ( "field =" , field ) query . filter ( "term >=" , term_prefix ) query . filter ( "term <" , term_prefix + u"\uffff" ) return _fetch_all ( query )
Find entity keys matching a single search term prefix.
Find entity keys matching a single search term prefix .
"""Find entity keys matching a single search term prefix.

    Args:
      term: A unicode string containing a single search term.
      entity_kind: An optional string.  If given, the returned keys are
        restricted to entities of that kind.
      field: An optional string.  If given, the returned keys are restricted
        to matches for that particular field.

    Returns:
      A set of (db.Key, matching field) pairs.
    """
A set of (db.Key, matching field) pairs.
A set of ( db . Key matching field ) pairs .
term_prefix
entity_kind
An optional string.  If given, the returned keys are
restricted to entities of that kind.
An optional string . If given the returned keys are restricted to entities of that kind .
field
An optional string.  If given, the returned keys are restricted
to matches for that particular field.
An optional string . If given the returned keys are restricted to matches for that particular field .
term
A unicode string containing a single search term.
A unicode string containing a single search term .