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(...):
>
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
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):
I believe your error is tied to this section of code:
> for item in ingredDict:
> ingredient_item = Ingredients(ingredientKey=item['ingredientKey'],
>
> ingredientDescription=item['ingredientDescription'],
>
__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
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