diff options
Diffstat (limited to 'examples/versioning/__init__.py')
| -rw-r--r-- | examples/versioning/__init__.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/examples/versioning/__init__.py b/examples/versioning/__init__.py index f0e1cf543..f2f8832cf 100644 --- a/examples/versioning/__init__.py +++ b/examples/versioning/__init__.py @@ -1,7 +1,12 @@ """ -Illustrates an extension which creates version tables for entities and stores records for each change. The same idea as Elixir's versioned extension, but more efficient (uses attribute API to get history) and handles class inheritance. The given extensions generate an anonymous "history" class which represents historical versions of the target object. +Illustrates an extension which creates version tables for entities and stores +records for each change. The same idea as Elixir's versioned extension, but +more efficient (uses attribute API to get history) and handles class +inheritance. The given extensions generate an anonymous "history" class which +represents historical versions of the target object. -Usage is illustrated via a unit test module ``test_versioning.py``, which can be run via nose:: +Usage is illustrated via a unit test module ``test_versioning.py``, which can +be run via nose:: nosetests -w examples/versioning/ @@ -38,7 +43,8 @@ A fragment of example usage, using declarative:: all() \\ == [SomeClassHistory(version=1, name='sc1')] -To apply ``VersionedMeta`` to a subset of classes (probably more typical), the metaclass can be applied on a per-class basis:: +To apply ``VersionedMeta`` to a subset of classes (probably more typical), the +metaclass can be applied on a per-class basis:: from history_meta import VersionedMeta, VersionedListener @@ -55,7 +61,8 @@ To apply ``VersionedMeta`` to a subset of classes (probably more typical), the m # ... -The ``VersionedMeta`` is a declarative metaclass - to use the extension with plain mappers, the ``_history_mapper`` function can be applied:: +The ``VersionedMeta`` is a declarative metaclass - to use the extension with +plain mappers, the ``_history_mapper`` function can be applied:: from history_meta import _history_mapper |
