Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add marker interface for zodb nodes

  • Loading branch information...
commit 45b3f5d6d7576f974dd4d5695f48357277323054 1 parent 013c8d8
Robert Niederreiter authored
Showing with 13 additions and 0 deletions.
  1. +6 −0 src/node/ext/zodb/__init__.py
  2. +7 −0 src/node/ext/zodb/__init__.rst
View
6 src/node/ext/zodb/__init__.py
@@ -92,9 +92,15 @@ def __repr__(self):
return "OOBTodict()"
+class IZODBNode(INode):
+ """Marker for ZODB nodes.
+ """
+
+
class ZODBPart(Part):
"""This part requires plumbed class to inherit from Persistent.
"""
+ implements(IZODBNode)
@extend
@property
View
7 src/node/ext/zodb/__init__.rst
@@ -178,11 +178,15 @@ Test OOBTodict::
ZODBNode. Based on PersistentDict as storage::
+ >>> from node.ext.zodb import IZODBNode
>>> from node.ext.zodb import ZODBNode
>>> zodbnode = ZODBNode('zodbnode')
>>> zodbnode
<ZODBNode object 'zodbnode' at ...>
+ >>> IZODBNode.providedBy(zodbnode)
+ True
+
>>> root[zodbnode.__name__] = zodbnode
>>> zodbnode['child'] = ZODBNode('child')
>>> root
@@ -257,6 +261,9 @@ OOBTNode. Based on OOBTree as storage::
>>> oobtnode
<OOBTNode object 'oobtnode' at ...>
+ >>> IZODBNode.providedBy(oobtnode)
+ True
+
>>> root[oobtnode.__name__] = oobtnode
>>> oobtnode['child'] = OOBTNode('child')
>>> sorted(root.keys())
Please sign in to comment.
Something went wrong with that request. Please try again.