[DB-SIG] WHat's the status of DB modules and datetime.py support?

Federico Di Gregorio fog at initd.org
Tue Dec 30 16:51:49 EST 2003


Il mar, 2003-12-30 alle 22:48, Simon Willison ha scritto:
> Federico Di Gregorio wrote:
> > right now psycopg allow user code to hook a conversion function into its
> > typecasting machinery. you can ask psycopg "when you encounter a date
> > just call my function and use the result". that means you can have right
> > now 2.3's datetime objects.
> 
> That sounds ideal - we can use a custom conversion function for the 
> moment and upgrade to psycopg2 in a month or so. Thanks for the tip.

the geotypes package (included in latest psycopg packages or available
separately) is a very good example of how to use the new_type and
register_type functions. it provides automatic type casting from
postgresql geo types to python.

-- 
Federico Di Gregorio                         http://people.initd.org/fog
Debian GNU/Linux Developer                                fog at debian.org
INIT.D Developer                                           fog at initd.org
              La felicità è una tazza di cioccolata calda. Sempre. -- Io
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Questa parte del messaggio =?ISO-8859-1?Q?=E8?= firmata
Url : http://mail.python.org/pipermail/db-sig/attachments/20031230/2e59e774/attachment.bin


More information about the DB-SIG mailing list