How do you go about submiting two forms at once?

or do you need to create a SQLFORM.factory and then split the vars up
manually?

On Sep 17, 4:52 pm, Yarko Tymciurak <[email protected]> wrote:
> On Thu, Sep 17, 2009 at 10:55 AM, Thadeus Burgess 
> <[email protected]>wrote:
>
> > I have tried this many different ways and have yet to be successful.
>
> > Making a Many-to-many query is easy, and displaying the data is easy, but
> > how do I use SQLFORM with a M-M relationship!?
>
> Not sure what you are asking - if you have a m-2-m table, it is nothing but
> a referential table.
>
> If you update one table (e.g.  book section 6.9, p.190 - db.person), then
> ... give an example of what you want to do?
> If you want to have a form to enter a person (owner) name, for example, and
> let them list the dogs they own, this is two forms (logically) and a
> controller will fill out the relationship table (not the form).
>
> But maybe I am not quessing at your question correctly?
>
> - Yarko
>
> > -Thadeus
>
> > On Tue, Sep 15, 2009 at 12:08 PM, Thadeus Burgess 
> > <[email protected]>wrote:
>
> >> How would you go about using SQLFORM on a database object that has a many
> >> to many relationship.
>
> >> My current model displays correctly, however it errors on submit.
>
> >> Thanks for the help!
>
> >> """
> >> Table definition
> >> """
> >> db.define_table("room",
> >>       Field("name", "string"),
> >>       Field("size", "integer"))
>
> >> """
> >> Table definition
>
> >> db.table.field.requires=IS_IN_DB(db,'othertable.id
> >> ','%(otherfield)',multiple=True)
> >> """
> >> db.define_table("study",
> >>       Field("number", "string"),
> >>       Field("rooms", db.room, requires=IS_IN_DB(db, 'room.id', 'room.name',
> >> multiple=True)),
> >>       )
>
> >> TypeError: int() argument must be a string or a number, not 'list'
>
> >> -Thadeus
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to