Wow! str(model.id) did the trick !!
On Sep 21, 2:21 pm, juanduke <juan.fu...@gmail.com> wrote: > Hi Omi: > > I think you must have a error in this line: > > result += "<option value='" + model.id + "'" > > Just because you are trying to concat a String with a Long. And not because > the model.id is wrong. > Try using str() function like this: > > result += "<option value='" + *str(*model.id*)* + "'> some text maybe > showing id too:"+ *str(*model.id*)* +"</option>" > > or this one, more pythonic: > > result += "<option value='%s'> some text maybe showing id too:%s</option>" % > (model.id, model.id) > > Another thing I use to do, is print variables that I'm using, just to see if > is something wrong with it. > I mean: > > print "model.id:", model.id > result += "<option value='%s'> some text maybe showing id too:%s</option>" % > (model.id, model.id) > > And watch the console where w2p is running, to see the output. > > HTH. > > Bye > > PS: doble check my code, maybe having a typo