On Oct 14, 8:15 am, Alex Vartan <[EMAIL PROTECTED]> wrote:
> Apologies if this is a simple question, I'm still a python / GAE
> novice. Is it possible to subclass the User class? I have just a
> couple of extra properties and I'd like to store with User and rather
> not create a duplicated UserOfMyApp class that includes a user as a
> property if I can just subclass the User class itself.
>
> What's the best solution if I just want to store a reference to
> another model and a few integerproperties with a user?

Composition is usually a better route.  The attributes and semantics
of the Google Accounts User instance are most likely different from
those of your application's user.  Handling the User as an attribute
will let you associate it freely with more than one entity, if your
application requires it.

In addition to making it an attribute, you may also want to have a
couple of domain-specific utility methods that perform the User
handling for your application.  Also, take a look at entity groups and
keys in the Datastore API.

Good luck and cheers,

pr3d4t0r
http://www.istheserverup.com
http://www.theteslatestament.com

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