Perfect!
Thank You very much.
On Thursday, October 20, 2016 at 4:11:52 PM UTC+3, Scott Hunter wrote:
>
> Your fields are of type string (the default); so either make string
> representations of your lists or declare the fields as lists of strings.
>
> Or, if you are trying to use this data to define *multiple* records,
> something like this might do what you want:
>
> for i in xrange(3):
> db.color.insert( blue=COLORED_THINGS['blue'][i],
> yellow=COLORED_THINGS['yellow'][i], red=COLORED_THINGS['red'][i] )
>
> On Wednesday, October 19, 2016 at 9:15:21 AM UTC-4, Tribo Eila wrote:
>>
>> Hi,
>>
>> supposed:
>> db.define_table('color', Field('blue'),Field('yellow'),Field('red'))
>>
>> COLORED_THINGS = {
>> 'blue': ['sky', 'jeans', 'powerline insert mode'],
>> 'yellow': ['sun', 'banana', 'phone book/monitor stand'],
>>
>> 'red': ['blood', 'tomato', 'test failure']}
>>
>> using db.color.insert(...). i'm trying to figure how to save in database
>> base on key dict. i tried for loops but my head starts turning.
>>
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
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/d/optout.