logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

Re: Re: psycopg -- using python 2.3's built-in datetime vs. mx.DateTime: msg#00071

Subject: Re: Re: psycopg -- using python 2.3's built-in datetime vs. mx.DateTime
Il giorno gio, 25-11-2004 alle 13:29 +0100, Matteo Giacomazzi ha
scritto:
> Hi Adrian,
> 
> > While we're on the subject, the mogrification code in the version of
> > psycopg  I'm  using (1.1.11) doesn't properly call str() on datetime
> > objects,  forcing  me to wrap a str() around each datetime.datetime,
> > datetime.date,  or  datetime.time that I use in a database query. Is
> > this  something that could be fixed in psycopg, or is the problem in
> > the datetime module?
> 
> I could not find any response to this question.
> Since  I'm  experiencing the same problem using 1.1.17 I wonder what's
> the better solution or workaround known.

use the right DBAPI constructors (DateFromXXX) or write your own type
caster and register it (see the usercast.py example is psycopg
ditribution) or start testing psycopg 2.

federico


<Prev in Thread] Current Thread [Next in Thread>