No, db.commit() should not be necessary as long as the inserts are part of 
a request (committing happens automatically at the end of the request).

Anthony

On Sunday, March 17, 2013 3:37:01 PM UTC-4, Richard wrote:
>
> You may need to db.commit() because the manual insert may not commit 
> normally maybe??
>
>     if form.process().accepted:
>         for i in range(0, int(request.vars.row)):
>             db.company.insert(company=form.vars['company_%s' % i])
>         db.commit()
>
> But I am not sure I understand you onkeyup ajax call what's the intent of 
> it???
>
> Richard
>
>
> On Sun, Mar 17, 2013 at 9:48 AM, 黄祥 <[email protected] 
> <javascript:>>wrote:
>
>> @anthony : thank you for correcting me anthony
>> @richard : i'm learning to use 2 input form too but not work as expected 
>> (no error occured), the data is not insert after i submit it. any idea 
>> about this?
>> thank you
>>
>> *default.py*
>> def test():
>>     inputs = []
>>     for i in range(0, int(request.vars.row)):
>>         inputs.append(db.company.company.clone(name='%s_%s' % (
>> db.company.company.name, i)))
>>     form = SQLFORM.factory(*inputs)
>>     if form.process().accepted:
>>         for i in range(0, int(request.vars.row)):
>>             db.company.insert(company=form.vars['company_%s' % i])
>>     elif form.errors:
>>         response.flash = 'form has errors'
>>     return dict(form=form)
>>
>> def index():
>>     return dict()
>>
>> *index.html*
>> {{extend 'layout.html'}}
>>
>> <form>
>>    <input name="row" onkeyup="ajax('test', ['row'], 'target')" />
>> </form>
>>
>> <div id='target'></div>
>>
>> -- 
>>  
>> --- 
>> 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