I have this datastore model:
class Person(db.Model):
person_name = db.StringProperty(required = True)
nacionality = db.StringProperty(required = True)
marital_status = db.StringProperty(required = True)
profession = db.StringProperty(required = True)
SSN = db.IntegerProperty(required = True)
driver_license = db.IntegerProperty(required = True)
address = db.PostalAddressProperty(required = True)
In this Model, person_name could be something like this: 'Carl Sagan' (there is only on property for the entiry name). But when I query it, this way:
searched_name = 'Carl'
p = Person.all()
persons = p.filter('person_name >=', searched_name)
I got, as a result, names which doesn't begin with 'Carl' or neither have 'Carl' in any part of the name. If I query this way: persons = p.filter('person_name >=', searched_name)
I got none result (even 'Carl Sagan' isn't found). So, I'd like to know: what is the best filter to this kind of query? (quering a complete name property using only the first name)?
String filter works as it was comparing chars starting beginning of string. You can do something like this: