Re: How to make a dictoinary list of a query result

Поиск
Список
Период
Сортировка
Искать

Re: How to make a dictoinary list of a query result

От:
Mikhail Terekhov <terekhov@emc.com>
Дата:
Use "Classic" interface:

import pg

con = pg.connect(...)
d = con.query('select id,name from account').dictresult()
print d



sanjay wrote:
> Hi All,
> 
>   How to make a dictoinary list of a query result.
> Example.
> select id,name from account.
> it should be like [{'name':aaa,'id':12},{'name':bbb,'id':23},...]
> 
> Thanks,
> Sanjay

FAQ