What you would like to use is:
result = UserSetting.get_or_insert(key_name='user:%s' %
users.get_current_user(), owner users.get_current_user())
On Sep 26, 6:08 pm, fedekun <[EMAIL PROTECTED]> wrote:
> Hi, i want to save some settings for each user, and the way i'm doing it so
> far is
>
> title = self.request.get("title")
>
> result = UsersSettings.gql("WHERE owner=:1",
> users.get_current_user().nickname())
> if result.count() == 0:
> result = UsersSettings()
>
> result.title = title
> result.owner = users.get_current_user().nickname()
>
> db.put(result)
>
> What i want to do is create it if it doesnt exists or else modify it, but i
> cant figure out why it does not modify it, it creates it but i cannot modify
> it :(
> --
> Best Regards.
> fedekun
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---