How do I correctly reference Users in GQL queries on App Engine? -


i have db.model has db.userproperty. example:

class photo( db.model ):     owner = db.userproperty()     title = db.stringproperty() 

when want photos user, this:

photos = photo.gql( "where owner = user(:1)", users.get_current_user().nickname() ) 

this causing problems, however, between google , non-google nicknames. when testing locally, if use email address test@example.com, nickname "test@example.com". if use test@gmail.com, nickname "test". when test gmail account, have append "@gmail.com" .nickname().

is there better way hard-coding + "@gmail.com" database queries?

photos = photo.gql("where owner = :1", users.get_current_user())


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -