How I could re-instanciate each field in my for loop?
If I do this :
inputs = []
for i in range(0,10):
inputs.append(db.table1.field1)
inputs.append(db.table1.field2)
Even if I get 10 inputs of each they all refer to the same instance so when
I render the form with SQLFORM.factory I only get my 2 fields, but I would
have 10 of each...
Thanks
Richard
On Fri, Mar 8, 2013 at 10:33 AM, Richard Vézina <[email protected]
> wrote:
> Ok, forget about that, I didn't know I could just do this :
>
> SQLFORM.factory(db.table1.field1, db.table1.field2)
>
> Richard
>
>
> On Fri, Mar 8, 2013 at 10:26 AM, Richard <[email protected]>wrote:
>
>> Hello,
>>
>> I would like to build a form that will contain many row for the same
>> table to make a kind of batch insert of record a given table.
>>
>> Now I am searching a way to append many different instance of the same
>> fields definition for a given table into SQLFORM.factory... Something like
>> that :
>>
>> inputs = []
>> for i in range(0,10):
>> inputs.append(subSetOfTableDifinedField) # HERE I would avoid
>> redefining the field of the table that are already defined
>>
>> form = SQLFORM.factory(*inputs)
>>
>> So, I would like to get : Field('field1', 'type', ...) of a given table
>> define...
>>
>> Are the field of each table define contained in a variable internally
>> that I can access or web2py only parse Models?
>>
>> Thanks
>>
>> Richard
>>
>> --
>>
>> ---
>> 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.