On Sat, Dec 31, 2016 at 09:46:32AM +0100, Christoph Zwerschke wrote:
> Am 31.12.2016 um 00:00 schrieb Justin Pryzby:
> >It seems to me you can just do:
> > def query_formatted(self, command, parameters=[], types=None,
> > inline=False):
>
> This would work, but I always try to avoid using mutable objects as default
> parameters, and use None as placeholder for "nothing". I have changed it in
> the trunk - let me know if that solves your problem.
No, that doesn't work;
Traceback (most recent call last):
File "/tmp/tpy", line 11, in <module>
print db.query_formatted('SELECT * FROM sites WHERE site_geo IS NOT
NULL').getresult()[0]
File "/usr/lib64/python2.6/site-packages/pg.py", line 1750, in query_formatted
command, parameters, types, inline))
File "/usr/lib64/python2.6/site-packages/pg.py", line 650, in format_query
raise TypeError('The values must be passed as tuple, list or dict')
TypeError: The values must be passed as tuple, list or dict
Justin
_______________________________________________
PyGreSQL mailing list
[email protected]
https://mail.vex.net/mailman/listinfo.cgi/pygresql