title: Sqla flask two ForeignKey the same table
body: <p>I have a table "ProductVariant"</p>
  
  <pre><code>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)
  </code></pre>
  
  <p>and i cant understand how i need create a back ref in the table "Vendor"</p>
  
  <pre><code>class Vendor(sqla.Model, ExtendMixin):
   pv_vendors = sqla.relationship(
          'ProductVariant',
          backref='vendor')
      pv_decorators = sqla.relationship(
          'ProductVariant',
          backref='vendor')
  </code></pre>
  
  <p>i have an error:</p>
  
  <p><code>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.</code></p>
  
  <pre><code>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.
  </code></pre>