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.
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!
Try unicode(modelID) in the filter instead of modelID.
I think GAE stores strings as unicodes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With