[Checkins] SVN: psycopgda/trunk/adapter.py Due to popular demand
from sqlos users implement a marker interface
Brian Sutherland
jinty at web.de
Sun Sep 10 07:37:14 EDT 2006
Log message for revision 70084:
Due to popular demand from sqlos users implement a marker interface
for postgres connections.
First proposed in the thread starting here:
http://mail.zope.org/pipermail/zope3-dev/2005-November/016340.html
Changed:
U psycopgda/trunk/adapter.py
-=-
Modified: psycopgda/trunk/adapter.py
===================================================================
--- psycopgda/trunk/adapter.py 2006-09-10 06:29:37 UTC (rev 70083)
+++ psycopgda/trunk/adapter.py 2006-09-10 11:37:12 UTC (rev 70084)
@@ -15,10 +15,12 @@
$Id$
"""
+
+from zope.interface import implements
from zope.rdb import (
ZopeDatabaseAdapter, parseDSN, ZopeConnection, ZopeCursor
)
-from zope.rdb.interfaces import DatabaseException
+from zope.rdb.interfaces import DatabaseException, IZopeConnection
from zope.publisher.interfaces import Retry
from datetime import date, time, datetime, timedelta
@@ -380,8 +382,14 @@
raise
+class IPsycopgZopeConnection(IZopeConnection):
+ """A marker interface stating that this connection uses PostgreSQL."""
+
+
class PsycopgConnection(ZopeConnection):
+ implements(IPsycopgZopeConnection)
+
def cursor(self):
"""See IZopeConnection"""
return PsycopgCursor(self.conn.cursor(), self)
More information about the Checkins
mailing list