Re: [sqlalchemy] ORM AmbiguousForeignKeysErro

2020-09-08 Thread Richard Damon
On 9/8/20 8:02 PM, Mark Aquino wrote: > I’m not using that FK for inheritance though. I’m just relating one > type of tracked entity to another (it’s parent, basically). After I > did this it actually broke my code so it didn’t really work (it just > temporarily got rid of one error and caused a

Re: [sqlalchemy] ORM AmbiguousForeignKeysErro

2020-09-08 Thread Mark Aquino
So if I’m understanding correctly then the inherit_condition should be the column mapping the subclass to the superclass? In my case TrackedEntity.id == Request.id? Mark Aquino From: sqlalchemy@googlegroups.com on behalf of Mike Bayer Sent: Tuesday, September

Re: [sqlalchemy] ORM AmbiguousForeignKeysErro

2020-09-08 Thread Mike Bayer
the error is raised because there is more than one column on your subclass table that is a foreign key to the superclass table. SQLAlchemy refuses to guess which of these columns it should use to create the join condition between superclass and subclass table. On Tue, Sep 8, 2020, at 4:50

Re: [sqlalchemy] ORM AmbiguousForeignKeysErro

2020-09-08 Thread Mark Aquino
I’m not using that FK for inheritance though. I’m just relating one type of tracked entity to another (it’s parent, basically). After I did this it actually broke my code so it didn’t really work (it just temporarily got rid of one error and caused a more complicated one) Mark Aquino

Re: [sqlalchemy] ORM AmbiguousForeignKeysErro

2020-09-08 Thread Richard Damon
The key point is that the derived class needs a pointer to its base class for the inheritance, and if it has another one to represent object linkage, then the ORM module doesn't know which one is which, in my case even though they were all called node_id, the fact one of the classes had another

Re: [sqlalchemy] ORM AmbiguousForeignKeysErro

2020-09-08 Thread maqui...@gmail.com
I'm having the same problem, I have a base class called TrackedEntity that has child classes like Request and others that inherit from it on Request I wanted to put a reference to the id of the TrackedEntity that created the Request class Request(TrackedEntity, TrackedEntityContainer,