У меня есть таблица "ProductVariant"
class ProductVariant(sqla.Model, ExtendMixin, ResourcesMixin):
vendor_id = sqla.Column(
sqla.Integer,
sqla.ForeignKey('vendors.id'),
nullable=True)
decorator_id = sqla.Column(
sqla.Integer,
sqla.ForeignKey('vendors.id'),
nullable=True)
, и я не могу понять, как мне нужно создать обратную ссылку в таблице "Vendor"
class Vendor(sqla.Model, ExtendMixin):
pv_vendors = sqla.relationship(
'ProductVariant',
backref='vendor')
pv_decorators = sqla.relationship(
'ProductVariant',
backref='vendor')
У меня ошибка:
sqlalchemy.exc.AmbiguousForeignKeysError: Could not determine join condition between parent/child tables on relationship Vendor.pv_vendors - there are multiple foreign key paths linking the tables. Specify the 'foreign_keys' argument, providing a list of those columns which should be counted as containing a foreign key reference to the parent table.
sqlalchemy.exc.AmbiguousForeignKeysError: Can't determine join between 'vendors' and 'product_variants'; tables have more than one foreign key constraint relationship between them. Please specify the 'onclause' of this join explicitly.