db.define_table('products',
Field('thumbnail',
'upload',uploadfield='image_data',represent=lambda v, r:
IMG(_src=URL('download',args=v))),
Field('image_data', 'blob',readable=False),
Field('name',unique=True,represent=lambda v, r:
A(v,_href=URL('view',args=[db.products,r.id])) + XML('<br>'+r.description)),
Field('category',represent=lambda v, r:
DIV(v,_style='width:75px;word-wrap:break-word;')),
Field('description','text',represent=lambda v, r: ''),
Field('choices','text',readable=False),
Field('shift','list:string',readable=False),
I initialize the field with .update(shift=['colour','size'])
When I retrieve the field, I indeed can access the list items. However, in
admin, I see this:
<https://lh4.googleusercontent.com/-EfRWKJ_pUWQ/Uz1spRS9D0I/AAAAAAAAA40/H6TpxX6w7oM/s1600/Screen+Shot+2014-04-03+at+10.08.10+AM.png>
I know the data is in the field. Why can't I see it??
On Thursday, 3 April 2014 09:37:41 UTC-4, Anthony wrote:
>
> Can we see some code (and maybe a screenshot of what you see)? The default
> list:string widget requires an up-to-date web2py.js file.
>
> On Thursday, April 3, 2014 12:23:08 AM UTC-4, horridohobbyist wrote:
>>
>> I've added a 'list:string' field to my table, but when adding a new
>> record from admin (using the new record form), I can't figure out how to
>> enter the data. I don't understand what format it expects.
>>
>> I tried "['item1','item2']". I tried "|'item1'|'item2'|". They both
>> don't work.
>>
>
--
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.