title: How to filter from joined table in sqlalchemy?
body: <p><a href="https://i.stack.imgur.com/iyJ49.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iyJ49.png" alt="enter image description here" /></a></p>
  <p>Hello everyone, I'm very new with sqlalchemy and I try to do a searching module from any field that I input from the user by the below code.</p>
  <pre><code>    filters = []
  
      if 'inputVendorName' in inputfield:
          filters.append(Vendors.vendor_name.contains(inputfield['inputVendorName']))
  
      if 'inputProductName' in inputfield:
          filters.append(Product.product_name.contains(inputfield['inputProductName']))
  
      if 'inputCustomerName' in inputfield:
          filters.append(Customers.customer_name.contains(inputfield['inputCustomerName']))
  
      if 'inputSalePrice' in inputfield:
          filters.append(Sales.price.contains(inputfield['inputSalePrice']))
  
      # jointable --&gt; how to join table
      results = jointable.query.filter(db.or_(*filters)).all()
  
  </code></pre>
  <p>Begin with <code>fiters</code> is a list that contains any input value from the user, and I want to use these values in a list to filter from my join table.</p>
  <p>For example, the user has input some <code>product_name</code> and I want to use this <code>product_name</code> to filter and get any record value in <code>Products</code> table that matches to <code>product_name</code> and also gets the other record from another table (Vendors, Sales, Customers) that related to this 'product_name'.</p>
  <p>So how can I do that?</p>