From 0148adec3069c64f3dca8d269e4c0fac3fe6bcaf Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Wed, 12 Nov 2008 15:43:17 +0000 Subject: - Can now use a custom "inherit_condition" in __mapper_args__ when using declarative. --- lib/sqlalchemy/ext/declarative.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/sqlalchemy/ext/declarative.py') diff --git a/lib/sqlalchemy/ext/declarative.py b/lib/sqlalchemy/ext/declarative.py index b7ae47edf..a26156844 100644 --- a/lib/sqlalchemy/ext/declarative.py +++ b/lib/sqlalchemy/ext/declarative.py @@ -311,7 +311,7 @@ def _as_declarative(cls, classname, dict_): inherits = cls._decl_class_registry.get(inherits.__name__, None) if inherits: mapper_args['inherits'] = inherits - if not mapper_args.get('concrete', False) and table: + if not mapper_args.get('concrete', False) and table and 'inherit_condition' not in mapper_args: # figure out the inherit condition with relaxed rules # about nonexistent tables, to allow for ForeignKeys to # not-yet-defined tables (since we know for sure that our -- cgit v1.2.1