Re: [web2py] Re: list:string thoughts

2010-11-23 Thread Bruno Rocha
I deleted my database, redefined the tables and now it works. I found the problem. First defined Field('valores') After some values inserted, and some deletions, I changed to Field('valores','list:string') But this still renders pure strings '|x|x|' changing fields from 'string' to 'list:str

[web2py] Re: list:string thoughts

2010-11-23 Thread mdipierro
This is what I get from shell: >>> db.define_table('doacao', ...Field('animais','list:string'), ...Field('valores','list:string')) >>> order = [(12,1,21.4),(15,1,45.3)] >>> doacao = dict( ... animais=[ord[0] for ord in order], ... valores=[ord[2] for ord in order]

Re: [web2py] Re: list:string thoughts

2010-11-23 Thread Bruno Rocha
This is what I have: order = [] for product_id, qty, val in session.cart: order.append(( product_id, qty, val )) store.define_table('doacao', Field('user_id',db.auth_user,requires=IS_IN_DB(db, db.auth_user.id)), Field('animais','list:string'),

[web2py] Re: list:string thoughts

2010-11-23 Thread mdipierro
No it does not. This is what I get: >>> db.define_table('name',Field('value','list:string')) >>> db.name.insert(value=['hello','world']) 1 >>> db.name(1).value ['hello', 'world'] >>> for row in db(db.name).select(): print row at 0x1698f70>, 'value': ['hello', 'world'], 'id': 1, 'delete_record':

Re: [web2py] Re: list:string thoughts

2010-11-23 Thread Bruno Rocha
HI, I am taking advantage of this thread to solve a doubt about list:string, How can I get the values from list:string field rendered as a Python 'list' ? Is there a ready way in DAL, or I need to use .split() and .join() ? look: >>> row = db(db.doacao.user_id==23).select()[0] >>> row at 0x930a

[web2py] Re: list:string thoughts

2010-10-25 Thread mdipierro
h. that is possible. Will look into it. On Oct 25, 3:59 pm, yamandu wrote: > It seems that this widget does not work when there is more than one > list:string field in a page. > > On Oct 25, 2:01 am, mdipierro wrote: > > > The list:string is not an alternative to using a tag table and > > ta

[web2py] Re: list:string thoughts

2010-10-25 Thread yamandu
It seems that this widget does not work when there is more than one list:string field in a page. On Oct 25, 2:01 am, mdipierro wrote: > The list:string is not an alternative to using a tag table and > tag_link many-to-many (an example of which is provided by > plugin_tagging). > > Yet you should

[web2py] Re: list:string thoughts

2010-10-24 Thread mdipierro
The list:string is not an alternative to using a tag table and tag_link many-to-many (an example of which is provided by plugin_tagging). Yet you should not have the problem you experience. With recent versions of web2py, Field('keywords', 'list:string') should be rendered by a new widget that tak