[Zope-CVS] CVS: Products/Ape/lib/apelib/sql - oidgen.py:1.5
Shane Hathaway
shane at zope.com
Fri Mar 26 10:53:19 EST 2004
Update of /cvs-repository/Products/Ape/lib/apelib/sql
In directory cvs.zope.org:/tmp/cvs-serv22823/lib/apelib/sql
Modified Files:
oidgen.py
Log Message:
Simplified OID generation.
The complexity existed to support path-based OIDs, but Ape no longer
needs path-based OIDs.
=== Products/Ape/lib/apelib/sql/oidgen.py 1.4 => 1.5 ===
--- Products/Ape/lib/apelib/sql/oidgen.py:1.4 Sat Mar 20 01:34:23 2004
+++ Products/Ape/lib/apelib/sql/oidgen.py Fri Mar 26 10:52:49 2004
@@ -37,14 +37,8 @@
elif event.clear_all:
conn.reset_sequence(self.table, start=1)
- def new_oid(self, event, name, stored):
- if not stored:
- raise exceptions.ConfigurationError(
- 'OIDs generated by SQLOIDGenerator must be stored')
- if interfaces.ISDEvent.isImplementedBy(event):
- # Request that the other side do the work (for ZEO)
- n = event.obj_db.new_oid()
- else:
- conn = self.get_connection(event)
- n = conn.increment(self.table)
+ def new_oid(self, event):
+ assert interfaces.IGatewayEvent.isImplementedBy(event)
+ conn = self.get_connection(event)
+ n = conn.increment(self.table)
return str(n)
More information about the Zope-CVS
mailing list