With node a unified robust tree structure can be build and with this package this structures can be persistet easily.
It provides two implementation types:
- node.ext.zodb.ZODBNode based on persistent.dict.PersistentDict,
- node.ext.zodb.OOBTNode based on BTrees.OOBTree.OOBTree.
Once the DB root object or any other contained persistent object is available adding nodes is as simple as so:
>>> from node.ext.zodb import ZODBNode >>> root['person'] = ZODBNode() >>> root['person'].attrs['name'] = "Willi" >>> root['person']['home'] = ZODBNode() >>> root['person']['home'].attrs['address'] = "Innsbruck, Austria" >>> root['person']['work'] = ZODBNode() >>> root['person']['work'].attrs['address'] = "Hall in Tirol, Austria"
Once the transaction is committed al changes are persistent.
For more information on node and its usage please refer to the node documentation.
The sources are in a GIT DVCS with its main branches at github.
We'd be happy to see many forks and pull-requests to make it even better.