On Tuesday, November 13, 2018 at 9:14:36 AM UTC-8, Paulo Serrão wrote:
>
> Hi!
>
> I have a table on a Postgres database that has a field of type integer[]
>
> Is there a way to use this directly in web2py/pydal and interact with it 
> as a python integer list?
>
> I want to be able to select that field and get a list with [1,2,3,4,5] and 
> I want to be able to update the field and put there [6,7,8,9,10]
>
> The best I could do was set the Field as 'string', that works with the 
> selects (I can loop thru the result and get the numbers), but unfortunately 
> it does not work for the update, it is generating the following SQL:
>
> UPDATE table SET table.fieldname='|6|7|8|9|10|' WHERE (table.id = 123);
>
> Is there a way to push an array back to Postgres?
>


Did you try list:integer?
<URL 
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Field-types
 
>

/dps

-- 
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.

Reply via email to