I use the get_value_for_datastore method. I usually add a method like 'userKey' to the model so that I can say: if article.userKey() != user.key()
See: http://code.google.com/appengine/docs/python/datastore/propertyclass.html and/or http://appengine-cookbook.appspot.com/recipe/getting-dbreferenceproperty-key-without-loading-entity Robert On Tue, May 4, 2010 at 7:03 PM, Blixt <[email protected]> wrote: > Hey! Isn't there a more convenient way to do the following? > > if article._entity['user'] != user.key(): > > "article" in the above is an instance of the model Article, which has > the property "user" which is a ReferenceProperty to the model User > (which "user" is an instance of). If I try to do "if article.user != > user" it tries to fetch the User instance for the article, despite > there being no need to do so. > > /Blixt > > -- > You received this message because you are subscribed to the Google Groups > "Google App Engine" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/google-appengine?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
