diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-06-14 19:57:21 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-06-14 19:57:21 -0400 |
commit | a59bff38dca6f2a42bb6e4b7d27da9833e61a9cb (patch) | |
tree | ff2c6afba2b59fa2745df995aafa20e7909ac2da /lib/sqlalchemy/ext/declarative.py | |
parent | 23a14f29da6607ee78f95c4bff9af7768c6e7954 (diff) | |
download | sqlalchemy-a59bff38dca6f2a42bb6e4b7d27da9833e61a9cb.tar.gz |
- remove NamingConventions as an example here since it doesn't apply
- add link to the concrete declarative thing
Diffstat (limited to 'lib/sqlalchemy/ext/declarative.py')
-rwxr-xr-x | lib/sqlalchemy/ext/declarative.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/sqlalchemy/ext/declarative.py b/lib/sqlalchemy/ext/declarative.py index 86fa8f355..27d05733b 100755 --- a/lib/sqlalchemy/ext/declarative.py +++ b/lib/sqlalchemy/ext/declarative.py @@ -316,9 +316,7 @@ and simply pass it to declarative classes:: Some configuration schemes may find it more appropriate to use ``__table__``, such as those which already take advantage of the data-driven nature of -:class:`.Table` to customize and/or automate schema definition. See -the wiki example `NamingConventions <http://www.sqlalchemy.org/trac/wiki/UsageRecipes/NamingConventions>`_ -for one such example. +:class:`.Table` to customize and/or automate schema definition. Mapper Configuration ==================== @@ -442,7 +440,9 @@ Concrete is defined as a subclass which has its own table and sets the name = Column(String(50)) Usage of an abstract base class is a little less straightforward as it -requires usage of :func:`~sqlalchemy.orm.util.polymorphic_union`:: +requires usage of :func:`~sqlalchemy.orm.util.polymorphic_union`, +which needs to be created with the :class:`.Table` objects +before the class is built:: engineers = Table('engineers', Base.metadata, Column('id', Integer, primary_key=True), @@ -472,6 +472,10 @@ requires usage of :func:`~sqlalchemy.orm.util.polymorphic_union`:: __table__ = managers __mapper_args__ = {'polymorphic_identity':'manager', 'concrete':True} +There is a recipe which allows the above pattern to be executed +using the declarative form, via a special base class that defers +the creation of the mapper. That recipe is available at +`DeclarativeAbstractConcreteBase <http://www.sqlalchemy.org/trac/wiki/UsageRecipes/DeclarativeAbstractConcreteBase>`_ Mixin Classes ============== |