t2.create uses 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
-~----------~----~----~----~------~----~------~--~---