Re: [sqlalchemy] ORM AmbiguousForeignKeysErro

2020-08-28 Thread Richard Damon
Thank you, so that go into each subclass that would have the problem.  8/28/20 2:37 PM, Mike Bayer wrote: > the argument you're looking for is inherit_condition: > > https://docs.sqlalchemy.org/en/13/orm/mapping_api.html#sqlalchemy.orm.mapper.params.inherit_condition > > > class Foo(...): >   

Re: [sqlalchemy] ORM AmbiguousForeignKeysErro

2020-08-28 Thread Mike Bayer
the argument you're looking for is inherit_condition: https://docs.sqlalchemy.org/en/13/orm/mapping_api.html#sqlalchemy.orm.mapper.params.inherit_condition class Foo(...): __mapper_args__ = { "inherit_condition": node_id == Node.node_id } On Fri, Aug 28, 2020, at 1:45 PM, Richard

[sqlalchemy] ORM AmbiguousForeignKeysErro

2020-08-28 Thread Richard Damon
Following code and error I am getting: class Base:     """Base Class for SQLAlchemy ORM Classes"""     @declared_attr     def __tablename__(cls):     """Default the Table Name to the Class Name"""     return cls.__name__ Base = declarative_base(cls=Base) class Node(Base):    

[sqlalchemy] Re: Update multiple rows in SQLite Databse

2020-08-28 Thread 'Jonathan Vanasco' via sqlalchemy
I believe your error is tied to this section of code: > for item in ingredDict: > ingredient_item = Ingredients(ingredientKey=item['ingredientKey'], > > ingredientDescription=item['ingredientDescription'], >

Re: [sqlalchemy] How can I use a composite foreign-key constraint with a "mixin" class using declarative?

2020-08-28 Thread Mike Bayer
__table_args__ don't merge automatically right now for mixins so you would need to use a __table_args__ function with @declared_attr and merge the constraints manually. see

[sqlalchemy] How can I use a composite foreign-key constraint with a "mixin" class using declarative?

2020-08-28 Thread Nicolas Lykke Iversen
Hi all, I need to create identical models (mapped classes) for several database backends, e.g. MySQL and MSSQL, that take different __table_args__. Thus, I've opted for created one base for each database backend defining the __table_args__ (*base.py*), while using common mixins for defining