Well, that's one thing you have to understand, about moving things into 
directories. When you want to create a file in a 'directory' you click the 
'create new file' button, give it the name 'houses/newfile.html' and it 
will be put in that new directory. 

I'm glad you liked it, it is very bare bones, but it does the job. I have 
been poking around web2py for quite a while now, and it's a lovely piece of 
software. I had used my own methods for doing ajax, but since I found this, 
I might have to change the way I do projects. I believe arg2 can also just 
take a form name (not in a list), and it will serialize it.

P.S. I call everything a 'folder' now since that's what Windows calls it. 
Makes it easier on the less technical people.

On Wednesday, March 20, 2013 2:17:12 PM UTC-7, Alex Glaros wrote:
>
> Hey Derek,
>
> that was great that you could post the example
>
> I'm a beginner and couldn't make it work in the "/houses" directory so 
> moved everything to "/default" directory. Just wasn't sure of things like 
> if houses.py had to be in "/houses" directory, and things like that.
>
> It works fantastic and it has just the right amount of bare-bones 
> functionality to help people get the main points.
>
> Thanks!
>
> Alex
>
>
>
> On Monday, March 18, 2013 5:33:41 PM UTC-7, Alex Glaros wrote:
>>
>> Does anyone know how to create a loop allowing variable number of child 
>> records to be added to a parent?
>>
>> Here’s a sample where only one child is created.  The “client” is the 
>> parent record and “address” is the child record. 
>> http://web2py.com/books/default/chapter/29/07
>>
>> Can anyone please type the code to show how to allow user to add variable 
>> number of child records?
>>
>> If it’s easier to do not using factory, that’s fine.
>>
>> Thanks,
>>
>> Alex Glaros
>>
>>
>> One form for multiple tables
>>
>> model:
>>
>> db.define_table('client',
>>
>>      Field('name'))
>>
>> db.define_table('address',
>>
>>     Field('client','reference client',
>>
>>           writable=False,readable=False),
>>
>>     Field('street'),Field('city'))
>>
>> controller:
>>
>> def register():
>>
>>     form=SQLFORM.factory(db.client,db.address)
>>
>>     if form.process().accepted:
>>
>>         id = db.client.insert(**db.client._filter_fields(form.vars))
>>
>>         form.vars.client=id
>>
>>         id = db.address.insert(**db.address._filter_fields(form.vars))
>>
>>         response.flash='Thanks for filling the form'
>>
>>     return dict(form=form)
>>
>>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to