form = crud.update(...,next='...')

is equivalent to

form = SQLFORM(...)
if form.accepts(request.vars,session):
    session.flash='....'
    redirect(next)

curd.create is the same as crud.update but makes a new record instead
of creating an existing one. When you use SQLFORM you explicitly pass
all parameters, while in crud.create/update you have some sensible
defaults and you change them via crud.settings.

You can add elements in both cases with

   form[0].append(TR('label',INPUT(_name='xxx'),''))

In crud.create/update you must process 'xxx' in the onaccept function.
In SQLFORM you have have more flexibility and you can do it after
accept, before redirect.


On Dec 11, 10:02 am, Mengu <whalb...@gmail.com> wrote:
> hi everyone,
>
> i was just wondering if it is possible to add a custom form element
> like an input or a drop down box to a crud.create. i also would like
> to know how sqlform is different than crud.
>
> thank you.
>
> Mengu

--

You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.


Reply via email to