wxpython-users

Ja wrote:

thank you on your reply on wxpython-users group
(Redirecting to Google Groups
<Redirecting to Google Groups).

Please keep the discussion on the list, where others may benefit.

I would like to complement my question. You asked about my country
settings, my country is Croatia, Europe, and when I pick a value from
date picker it goes like this: Mon 6 Jay 2014 00:00:00.
I use in my application wxpython and PostgreSQL database, and to
connect them, I use psycopg2.
I still have a trouble with query, still does not work.
If you have time to look on my code i will be very grateful.

The psycopg2 module uses %s for parameter substitution, not ?. There
are several different standards for this, and I couldn't tell you which
one to use until you mentioned which adapter you were using.

So, instead of this:

    upit1 = " SELECT zaposlenik.ime, zaposlenik.prezime, datumOD, datumDO FROM radnivijek JOIN zaposlenik ON zaposlenik.idZ=radnivijek.zaposlenik_idZ WHERE radnivijek.datumOD>= ? AND radnivijek.datumDO<= ? "

try this:

    upit1 = " SELECT zaposlenik.ime, zaposlenik.prezime, datumOD, datumDO FROM radnivijek JOIN zaposlenik ON zaposlenik.idZ=radnivijek.zaposlenik_idZ WHERE radnivijek.datumOD>= %s AND radnivijek.datumDO<= %s "

Other than that, your code looks basically correct.

···

--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

Hi Ja,

I haven't really followed the thread in detail.

Ja wrote:

....

  I would like to complement my question. You asked about my country
settings, my country is Croatia, Europe, and when I pick a value from
date picker it goes like this: Mon 6 Jay 2014 00:00:00.
I use in my application wxpython and PostgreSQL database, and to
connect them, I use psycopg2.

You might want to look at using SQLAlchemy instead of going directly to psycopg2. This would allow you to easily support different db backends and I really like that it generates the SQL for me (I use the 'declarative' extension).

http://sqlalchemy.readthedocs.org/en/rel_0_9/orm/extensions/declarative.html

Some sample code using wxPython was done ages ago by Mike and myself in MediaLocker - https://bitbucket.org/driscollis/medialocker

Werner

···

On 07/01/2014 18:04, Tim Roberts wrote: