[web2py] Re: Web2py - How to update a table field appending a string to an existing field value

2016-09-18 Thread Meinolf
Excellent, the None value was indeed the problem, so i just gave a default string value in the table definition as *Field('search_term', 'string', default='')* and now it works. Thanks a lot. On Monday, September 19, 2016 at 4:59:00 AM UTC+2, Massimo Di Pierro wrote: > > This works for me, I jus

[web2py] Re: Web2py - How to update a table field appending a string to an existing field value

2016-09-18 Thread Massimo Di Pierro
This works for me, I just tried: >>> db.define_table('rated_items', Field('search_term','string'), ) >>> k = db.rated_items.insert(search_term='a') >>> db(db.rated_items.id==k).update(search_term=db.rated_items.search_term+ 'b') >>> print db.rated_items[k] you probably have None

[web2py] Re: Web2py - How to update a table field appending a string to an existing field value

2016-09-16 Thread Meinolf
I had tried that and tried it just now but still gives a None value in the rated_items.search_term field. maybe it's got to do with the table def; my table definition is as follows: db.define_table('rated_items', Field('search_term','string'), Field('user_id', 'reference auth_user', defa

[web2py] Re: Web2py - How to update a table field appending a string to an existing field value

2016-09-15 Thread Massimo Di Pierro
This should work for appending strings to strings (not to lists of strings): myrow = db((db.rated_items.user_id==auth.user.id) & (db.rated_items.item_id==request.args(0))).update(search_term=db.rated_items.search_term+str(request.vars.search_term) On Thursday, 15 September 2016 17:00:09 UTC-5