Hi!
I tried User(email = email) and User.all().filter('email = ', email).get(), but both of them don't work for me.
Thanks
Hi!
I tried User(email = email) and User.all().filter('email = ', email).get(), but both of them don't work for me.
Thanks
Assuming you're using the Django variant of GAE, try:
User.all().filter(email = email)
You need to construct a User object for the user you want to filter by - I'm assuming here that your model includes a UserProperty. For example:
User.all().filter("user =", User(email)).get()
Failing that, you can denormalize, and store the user's email in an additional StringProperty field.
If you're using the user as the primary key on your entity, though, you'd be better off fetching the user___id from the User object and using it as the key name for the entity when you create it. Then, you can fetch it with User.get(user_id), which is much more efficient than doing a query.
The right answer is: User(email)
. Thats it:)
Thanks everyone, anyway.