Dont work for me:
form=t2.create(db.arr,vars={'name':'Test'})
name is a string-field in db.arr
I use latest version of web2py and t2/t3
I don't understand??!
On 8 Dec. 2008, 23:15, mdipierro <[email protected]> wrote:
> t2.createuses but differs from SQLFORM. You should use:
>
> form =t2.create(db.mytable,vars={'a_field_in_my_table':'some
> calculated value'})
>
> OR
>
> form =t2.create(db.mytable,vars=lambda
> form:form.vars.a_field_in_my_table=some_calculated_value(form))
>
> Massimo
>
> On Dec 8, 3:31 pm, stefaan <[email protected]> wrote:
>
> > Hello list,
>
> > A question about form default values:
> > I was hoping to do something like this in a controller:
>
> > form =t2.create(db.mytable)
> > form.a_field_in_my_table = "somecalculateddefaultvalue"
> > return dict(form = form)
>
> > Is this possible? And what would be the correct syntax for it ?
>
> > Best regards,
> > Stefaan.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" 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/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---