Something like google contact??

If so, I didn't saw nothing passing on this list since I post about that...
You can acheive something like that with component.

You make your form for adress loaded in a component in a view of your
contact and you reference the selected client in your component form... You
can pass it in the url as vars and there request it :

request.vars.clientid

I can come back with a detail example (code) later for now I am busy with
something.

Richard




On Tue, Mar 19, 2013 at 12:09 PM, Alex Glaros <[email protected]> wrote:

> @Richard,
>
> in the above example, "client" is the parent table, and "address" is the
> child table.
>
> I want users to be able to add parent record once, and then add as many
> child records of that parent as they want.
>
> thanks,
>
> Alex
>
>
> On Tuesday, March 19, 2013 9:06:01 AM UTC-7, Richard wrote:
>
>> Alex,
>>
>> What you meen by child record? You meen a foreign record or in web2py
>> language a new referenced record?
>>
>> Richard
>>
>>
>> On Mon, Mar 18, 2013 at 8:33 PM, Alex Glaros <[email protected]> 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<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 web2py+un...@**googlegroups.com.
>>>
>>> For more options, visit 
>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>> .
>>>
>>>
>>>
>>
>>  --
>
> ---
> 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.
>
>
>

-- 

--- 
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