Client Address
1 client can have many address... In web2py as far as I know you will do form creating client 1 in Client table Then go in form address and add as many address you need to to a client that you pick in a dropdown. I would like to add the many address in one form : Here the fields of the form : Name Street City So Name is Client field Street and city are Address field You can handle the form generation with SQLFORM.factory(db.client, db.address) Then the js I wrote let you add as many input you want for subform or table Address. So you get a new form from the view and you need to process the inputs to insert street and city from each inputs by pairs... street input1 city input1 insert street input2 city input2 insert Etc. I near of it... Richard On Thu, Jan 20, 2011 at 4:47 PM, mart <msenecal...@gmail.com> wrote: > I would really look at the Massimo's "audit trail" sample to do what > you are saying (or a mix of both?)... This is how I manage the request > app I mentioned (Like a recipe : many tables with few Fields (like > name:value) are put together... with a large enough inventory of > tables it becomes easy to extend and move forward with changing > demand... Anyways, I still need to try a few things that you mentioned > yesterday... The mental picture I keep in the back of my mind when > looking at what you sent looks like something I would use to manage > monthly bills (add a field for a new bill, and link it to a > category)... Here I would use a drop down to choose a table (like work > expense, or house expense, or kids, etc.... )... Does that define what > you are looking to do? > > On Jan 20, 3:54 pm, Richard Vézina <ml.richard.vez...@gmail.com> > wrote: > > I am hacking a lot to build a function to parse the resultant form to > insert > > as many rows as there is added with the js I write... > > > > It is quite tricky for me since I am not so experienced in the web2py > dev... > > I dev app... But dev web2py is something else. I will propose something > far > > from be complete solution. And I don't know if it will not introduce > > security concern into web2py. > > > > I need to be able to load more then one table at a time and let user add > the > > number of sub table rows he needs... Maybe I am not doing it the right > > way... > > > > Maybe I should add input fields from python and regenerate a new form > each > > time don't know... Will see what Massimo and other users think. > > > > I hope I have something working tomorrow. > > > > I have not actually look at what will happen with validator... It is > mostly > > work in progress. > > > > ;-) > > > > Richard > > > > On Thu, Jan 20, 2011 at 3:11 PM, Arun K.Rajeevan <the1.a...@gmail.com > >wrote: > > > > > > > > > > > > > > > > > The more dynamic the site develops into, I think it's better to use > > > something like GWT (or pyjams) > > > > > You don't have to sacrifice SEO by building complete site in GWT but > only > > > parts of it. > > > That way, you can utilize best of both worlds. > > > If you are using gwt you utilize many other grate libraries available > (like > > > ext-js wrapper for gwt) > > > > > May be this is not what you want. but an attempt to use gwt (or pyjams) > > > helps to write code in same language as we develop and is more > manageable ( > > > for me at least) >