[web2py] Re: global functions in models

2012-01-06 Thread Alan Etkin
Field objects (to define table fields) support default values try something like db...default = list() or Field("", ... , default=list()) I haven't used it but I guess that on record creation this should create an empty list field value. On 5 ene, 19:37, Tsvi Mostovicz wrote: > I managed to fin

Re: [web2py] Re: global functions in models

2012-01-05 Thread Tsvi Mostovicz
I managed to find the culprit. The function before it had a mismatched parentheses. So it would continue reading this function and fail on compilation. Thanks for all your replies. The append works, although if this is a new user and no list has been defined yet it won't. So I check if it returns

[web2py] Re: global functions in models

2012-01-04 Thread Alan Etkin
And if the auth_user field is of type list:, 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 wrote: > If you are doing post-registration process, you might want to use > auth.settings.register_onaccept:

[web2py] Re: global functions in models

2012-01-04 Thread Alan Etkin
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

[web2py] Re: global functions in models

2012-01-04 Thread Ross Peoples
Are you having trouble with the line: auth.user.my_budgets.append(session.table_token) Or with return? I only ask because the above line assumes that the current user object has a list by the name of my_budgets. Is this list created somewhere else in the code? Also, because the user may not act