thanks for the attached full example Steve

did you write it just to assist for this topic?

When I go to the app page I get:

invalid view (default/register_new.html)

do I need to import anything?

I will study it and try and get small pieces of it going a bit at a time so 
that I can understand how it works

regarding "did you take a look the discussion link above?", I did but I'm 
not experienced enough to get over my lack of understanding

much appreciated!

Alex

On Wednesday, March 20, 2013 1:05:21 AM UTC-7, 黄祥 wrote:
>
> did you take a look the discussion link above?
> please find attached file that on discussion link above
> hope this can help
>
> * 
>
> [image: 黄祥]
>
> スティファン クリスティ (黄祥)
>
> Stifan Kristi (Kou Shou)
>
> ジャカルタ、 インドネシア
>
> Jakarta, Indonesia
>
> 携帯。 +六二 八一八 七八三 一一八
>
> Cell. +62 818 783 118
>
> ウェブサイト : http://stevevanchristie.net
>
> Website : http://stevevanchristie.net
> *
>
>
> On Wed, Mar 20, 2013 at 12:02 PM, Alex Glaros <[email protected]<javascript:>
> > wrote:
>
>> is there any way to use python to create the loop?
>> *
>>
>> {{while user keeps adding records:}}
>>
>> {{pass parent ID to variable}}
>>
>> <P>{{run factory to create child record and auto-insert parentID}}</P>
>>
>> {{response.write('do you want to add more child records?')}}
>> {{pass}}*
>>
>> On Tuesday, March 19, 2013 3:21:39 PM UTC-7, Alex Glaros wrote:
>>>
>>> @Derek: I'm a newbie.  Where do I put the Ajax code...in controller, or 
>>> view..?  Does it need some kind of <script></script> or brackets 
>>> surrounding it?
>>>
>>> Can you please type the syntax for linking to a page where user can add 
>>> addresses?  I don't know the best format for linking to functions.  For 
>>> purposes of showing me, assume that the function is called "add_partners" 
>>> that I want to link to. Would it just be <a href="http://127.0.0.1:8000/
>>> **CEA/default/add_partners/<http://127.0.0.1:8000/CEA/default/add_partners/>">
>>>  
>>> add partner</a> ?
>>>
>>> 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<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] <javascript:>.
>> 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