This is correct in the sense that since you try to store a list, web2py 
thinks it is a 'list:string' type of object and escapes the list 
accordingly accordingly.
At the same time, the behavior in this case is not really specified and 
could be changed.


On Sunday, 6 January 2013 14:52:51 UTC-6, Alan Etkin wrote:
>
> >>> db.define_table("mytable", Field("mytext", "text"))
> <Table mytable (id,mytext)>
> >>> db.mytable.insert(mytext=(1,2,3,4))
> 1L
> >>> db.mytable[1].mytext
> '|1|2|3|4|'
> >>> print db.mytable[1].mytext
> |1|2|3|4|
>
> I am trying to implement native support for json data type in dal (for 
> databases like mongodb) and found this behavior
>
> Is this correct? I'd expect any non string object passed to 
> .insert/.update for text fields to be converted to database string type 
> (the one specified for the adapter), not a bar encoded string. Also, the 
> default widget is completed with the bar encoded value. I think that some 
> fields like text (anything but list:<type> in fact) should not bar encode 
> input.
>
> My version is
> web2py Version 2.4.1-alpha.2+timestamp.2013.01.06.09.27.15
>
>

-- 



Reply via email to