its a mapper arg called inherit_condition:  __mapper_args__ = 
{"inherit_condition": id==A.id}

On Jul 24, 2013, at 3:42 PM, Seth P <spadow...@gmail.com> wrote:

> The code below produces the error message below. How do I tell SQLAlchemy 
> that the inheritance join condition should be b.id == a.id rather than 
> b.parent_a_id == a.id? (I would think the primary_key=True could be a 
> hint...) I can't figure it out from the documentation.
> 
> class A(Base):
>     __tablename__ = 'a'
>     id = Column(Integer, primary_key=True)
> 
> class B(A):
>     __tablename__ = 'b'
>     id = Column(Integer, ForeignKey('a.id'), primary_key=True)
>     parent_a_id = Column(Integer, ForeignKey('a.id'))
> 
> sqlalchemy.exc.AmbiguousForeignKeysError: Can't determine join between 'a' 
> and 'b'; tables have more than one foreign key constraint relationship 
> between them. Please specify the 'onclause' of this join explicitly.
> 
> 
> Thanks,
> 
> Seth
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sqlalchemy+unsubscr...@googlegroups.com.
> To post to this group, send email to sqlalchemy@googlegroups.com.
> Visit this group at http://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to