Reputation: 7952
We are trying to compare strings, one is loaded from the datastore and the other is acquired from a HTML form using
modelID = self.request.get('fieldName')
Then we compare the two:
result = db.Query(modelName).filter('model_id =', modelID).fetch(limit=1)
But althout I checked the datastore viewer and clearly see that an entity exists with model_id = modelID, python insists they are not equal trampling my attempt to make my app work.
Upvotes: 3
Views: 136
Reputation: 7130
Search for spaces in the string
you can use the string.strip() function to get rid of them! spaces are evil and will prevent equality...
take care man!
Upvotes: 2
Reputation: 1094
Try unicode(modelID) in the filter instead of modelID.
I think GAE stores strings as unicodes.
Upvotes: 1