A user object needs to be stored in the datastore before it gets its id
populated.

On Tue, Aug 11, 2009 at 9:28 PM, epb <esbenbu...@gmail.com> wrote:

>
> I am trying to store some users in my app, but when I create a User
> instance using a valid Google account e-mail on my server, the object
> that is returned as no user_id (None is returned when I apply the
> user_id()-method). This is what I do, right before I want to store the
> user:
>
> user = users.User('someth...@gmail.com')
> logging.info('Adding: ' + user.email() + ' with id ' + user.user_id())
>
> Everytime it fails in the second line, saying that user.user_id() is
> None. This is the case on both my dev. server and on the Google-hosted
> app. What am I doing wrong?
>
> In the documentation it is stated that "When running under the
> development web server, all User objects are assumed to represent
> valid Google accounts when stored in the (simulated) datastore. The
> User object for a valid user can provide a unique ID value for the
> user that stays the same even if the user changes her email address.
> The user_id() method returns this ID, a str value." So a valid user
> means one with an ID, and as all users are valid on the dev. server,
> all should return an ID, right?
> >
>


-- 

Alkis

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to