diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-01-19 00:53:12 +0000 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-01-19 00:53:12 +0000 |
| commit | 40f8aadd582776524d3b98da1f577c2fc95619e7 (patch) | |
| tree | 753eec3802734f397953976824a252bb60829189 /examples/custom_attributes | |
| parent | 56fe538cc7d81ce264fc6504feb1ead5e17d0f55 (diff) | |
| download | sqlalchemy-40f8aadd582776524d3b98da1f577c2fc95619e7.tar.gz | |
- mega example cleanup
- added READMEs to all examples in each __init__.py and added to sphinx documentation
- added versioning example
- removed vertical/vertical.py, the dictlikes are more straightforward
Diffstat (limited to 'examples/custom_attributes')
| -rw-r--r-- | examples/custom_attributes/__init__.py | 8 | ||||
| -rw-r--r-- | examples/custom_attributes/custom_management.py | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/examples/custom_attributes/__init__.py b/examples/custom_attributes/__init__.py index e69de29bb..6f7613e5c 100644 --- a/examples/custom_attributes/__init__.py +++ b/examples/custom_attributes/__init__.py @@ -0,0 +1,8 @@ +""" +Two examples illustrating modifications to SQLAlchemy's attribute management system. + +``listen_for_events.py`` illustrates the usage of :class:`~sqlalchemy.orm.interfaces.AttributeExtension` to intercept attribute events. It additionally illustrates a way to automatically attach these listeners to all class attributes using a :class:`~sqlalchemy.orm.interfaces.InstrumentationManager`. + +``custom_management.py`` illustrates much deeper usage of :class:`~sqlalchemy.orm.interfaces.InstrumentationManager` as well as collection adaptation, to completely change the underlying method used to store state on an object. This example was developed to illustrate techniques which would be used by other third party object instrumentation systems to interact with SQLAlchemy's event system and is only intended for very intricate framework integrations. + +"""
\ No newline at end of file diff --git a/examples/custom_attributes/custom_management.py b/examples/custom_attributes/custom_management.py index b8ea70dfd..3c80183e2 100644 --- a/examples/custom_attributes/custom_management.py +++ b/examples/custom_attributes/custom_management.py @@ -82,6 +82,7 @@ class MyClass(object): class MyCollectionAdapter(object): """An wholly alternative instrumentation implementation.""" + def __init__(self, key, state, collection): self.key = key self.state = state |
