From: Mike Bayer Date: Tue, 14 Jun 2011 23:57:21 +0000 (-0400) Subject: - remove NamingConventions as an example here since it doesn't apply X-Git-Tag: rel_0_7_2~64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a59bff38dca6f2a42bb6e4b7d27da9833e61a9cb;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - remove NamingConventions as an example here since it doesn't apply - add link to the concrete declarative thing --- diff --git a/lib/sqlalchemy/ext/declarative.py b/lib/sqlalchemy/ext/declarative.py index 86fa8f3553..27d05733b7 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 `_ -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 `_ Mixin Classes ==============