And if the auth_user field is of type list:<type>, seems that even it
is ok to do simply:

auth.user.mylistfield.append(object)

without explicit db query or update

On 4 ene, 18:42, Alan Etkin <[email protected]> wrote:
> If you are doing post-registration process, you might want to use
> auth.settings.register_onaccept:
>
> register_onaccept is a list of functions or a single function or
> lambda that receive a form argument
>
> form.vars.id contains the id of the new auth_user record.
>
> For appending to a sequence stored in an auth_user record field, maybe
> it would be better to get the auth_user record field first with a db
> query, modify it and finally update the db record.
>
> On 4 ene, 11:54, tsvim <[email protected]> wrote:
>
> > Hi all,
>
> > I'm trying to use the callbacks for auth.settings.register_onvalidation.
> > I first put the function in controllers, when I discovered it should be in
> > models as the settings are there.
> > Now I have them in models, but I get a invalid syntax error on the last
> > line:
>
> > def register_new_table_token():
> >     auth.user.last_opened = session.table_token
> >     auth.add_membership(auth.add_group(session.table_token),auth.user.id)
> >     auth.user.my_budgets.append(session.table_token)
> >     return
>
> > This happens both when I have pass instead of return or I don't enter a
> > return statement.
>
> > Please help,
>
> > Thanks,
>
> > Tsvi
>
>

Reply via email to