Great. got it.
thanks.

On Feb 19, 10:13 pm, Nick Winter <[email protected]> wrote:
> When creating an AppUser, pass in key_name:
> user = AppUser(name="nwinter", key_name="nwinter")
>
> Better to remove potential for missing the key_name by putting it in
> the constructor:
>
> class AppUser(db.Model):
>   name = db.StringProperty()
>   ...
>
>   def __init__(self, *args, **kargs):
>     kargs["key_name"] = kargs["name"]
>
> Same thing with UserSettings. Then you can do:
>
> user = AppUser(name="nwinter")
> user.put()
>
> user = AppUser.get_by_key_name("nwinter")
> settings = UserSettings.get_by_key_name("nwinter")
--~--~---------~--~----~------------~-------~--~----~
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