David,

We don't have an API for retrieving a User object from the User's ID. One
approach you can take to solving this problem is to create a Profile class
that references the User ID in its Key field, using the Profile handler in
conjunction with the Key to retrieve this object instead. This is probably
the way you want to go. It has the added bonus of being extensible, allowing
you to store additional information for each user.

On Tue, Nov 10, 2009 at 3:23 AM, wings <[email protected]> wrote:

>
> I've been displaying a user's profile page at a url like this:
>
> /profile/a_user's_unique_id
>
> At the top of a profile page I display the user's nickname. And I use
> their unique id to fetch items they've favorited.
>
> I run into a problem, however, when this user wants to share their
> profile page with another person. I can't fetch a User object from a
> unique id, so I can't get a nickname for a profile page -- unless that
> user happens to be logged in.
>
> A simple solution to this is to create an instance of a
> UserPreferences model the first time they favorite something (with a
> key name set equal to the user's id), and save their nickname to the
> datastore. Then I could retrieve their nickname from the datastore
> whenever their profile page is accessed.
>
> Is this the recommended way to handle a user's nickname and
> preferences?
>
>
> >
>


-- 
Ikai Lan
Developer Programs Engineer, Google App Engine

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to