I have a db.Model that has a db.UserProperty. For example:
class Photo( db.Model ):
owner = db.UserProperty()
title = db.StringProperty()
When I want to get all the photos for a user, I do this:
photos = Photo.gql( "WHERE owner = USER(:1)", users.get_current_user().nickname() )
This is causing problems, however, between Google and non-Google nicknames. When testing locally, if I use the email address test@example.com, then the nickname is "test@example.com". If I use test@gmail.com, then the nickname is "test". When I test with a Gmail account, I have to append "@gmail.com" to .nickname().
Is there a better way to do this than hard-coding + "@gmail.com" to all my database queries?
photos = Photo.gql("WHERE owner = :1", users.get_current_user())