Begin forwarded message:
> To make the question even simpler: when you do the following in > psycopg: > > import psycopg > dsn = ... > conn = psycopg.connect(dsn) > crs = conn.cursor() > > What is the class of 'crs' in the above? More specifically, how would > it be referenced if a subclass were to be defined that used that > class?
in psycopg 1.1 cursors and connections can't be subclassed. in psycopg 2 you can subclass both and pass a 'factory' argument to the right function to have the engine instantiate objects of your type instead of the standard type. the types 'connection' and 'cursor' are in psycopg.extensions and the methods involved are:
psycopg.connect(dsn, ..., factory=connection_class) conn.cursor(factory=cursor_class)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Looks like psycopg won't be compatible with Dabo without doing a bunch of work. Good thing that there are other adapters out there!
___/ / __/ / ____/ Ed Leafe http://leafe.com/ http://dabodev.com/
©2004 Ed Leafe |