There is also this post:
http://groups.google.com/group/web2py/browse_thread/thread/b35c79b64a483a94#




On Sep 24, 9:26 pm, weheh <richard_gor...@verizon.net> wrote:
> You need to use SQLFORM.factory and then you can use custom forms in
> view by bracketing the form content with
>   {{=form1.custom.begin}}
>   custom form content
>   {{=form1.custom.end}}.
>
> Be sure to have a hidden input with the form name and that the form
> name is referenced in the controller's accept method
>   if form1.accepts(request.vars,formname="form1"):
>     response.flash='form accepted'
> You can reference multiple tables in SQLFORM.factory
> (db.table1,db.table2,...) but the fields in the tables must have
> unique names, i.e. this won't work if db.table1 has field "name" and
> db.table2 has field "name".
>
> You may have to turn off fields that aren't being used but that have
> requires validators. Do this in the controller by
>   db.table1.field1.readable=db.table1.field1.writable=False
>
> You also will have to manually insert into the db in the accepts
> clause with a statement like this:
>   db.table1.insert(field1=form1.vars.field1)
>
> Hope this helps.
>
> On Sep 24, 9:56 pm, BG <beege...@gmail.com> wrote:
>
> > Hi waTR,
>
> > Thank you for your help.
>
> > Although, like Arvind in the conversation you send me, I have objects
> > that span multiple tables.  Is there any other way of getting at the
> > form elements with FORM() or utilizing SQLFORM across multiple models?
>
> > Bill
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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