There was a previous post on using psycopg2 with Django here:

http://groups.google.com/group/django-users/browse_thread/thread/dc2197f0de69072a/d801feabc1144518


Note, with psycopg2, an additional argument seems to get passed (a
reference to the current cursor) to the typecast_* functions in
django/core/db/typecasts.py.  To use psycopg2, you'll have to make the
changes in the above post to django/core/db/backends/postgresql.py as
well as change the signitures on the typecast_* functions.  I did
something like this:

def typecast_timestamp (s)

becomes:

def typecast_timestamp (s, *args)

to all the typecast_* functions (Sorry no diff on the file.  Just
hacking through it.).

The purpose for this is to integrate support for a native list type
into django.  Psycopg2 supports postgresql arrays data types as Python
lists.  I deal with a lot of complex data and arrays (or lists) are a
must.

There was mention that when psycopg2 comes out of beta it will be
supported in Django.  Is there any plan to add array or list type
support at that time?

BTW, I've just started looking at Django after years with Zope and am
impressed.  It is a much more focused product than Zope (which is great
in many respects) or even Webware (also good) and may work much better
for my projects.

Reply via email to