diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-10-17 12:58:52 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-10-17 12:58:52 -0400 |
commit | 83d431048cd3aae409a4a13791b5f5d59af26023 (patch) | |
tree | e8ac1f240a0d87798bf1e98c0643c947bcad2b1d /lib/sqlalchemy/ext/declarative.py | |
parent | 1207bcc0fd6925a7322636c9334ef240822b5378 (diff) | |
download | sqlalchemy-83d431048cd3aae409a4a13791b5f5d59af26023.tar.gz |
and i screwed it up
Diffstat (limited to 'lib/sqlalchemy/ext/declarative.py')
-rwxr-xr-x | lib/sqlalchemy/ext/declarative.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/sqlalchemy/ext/declarative.py b/lib/sqlalchemy/ext/declarative.py index 1909d2912..e3e269beb 100755 --- a/lib/sqlalchemy/ext/declarative.py +++ b/lib/sqlalchemy/ext/declarative.py @@ -554,7 +554,12 @@ the above example would work just as well with:: class MyModel(Base, MyMixin): name = Column(String(1000)) -Because "name" is only present on ``MyMixin``. +This works because ``Base`` here doesn't define any of the +variables that ``MyMixin`` defines, i.e. ``__tablename__``, +``__table_args__``, ``id``, etc. If the ``Base`` did define +an attribute of the same name, the class placed first in the +inherits list would determine which attribute is used on the +newly defined class Augmenting the Base ~~~~~~~~~~~~~~~~~~~ |