title: sqlalchemy: subqueryload with filter on the subquery
body: <p>In sqlalchemy, is it possible to filter the result in the returned by subqueryloading of a relationship? Consider the following (please ignore any syntax/api errors)</p>
  
  <p>Relationship:</p>
  
  <pre><code>User.address = relationship(Address,
                              secondary = UserAddress,
                              primaryjoin = (User.userid == UserAddress.userid),
                              secondaryjoin = (UserAddress.addressid == Address.addressid))
  </code></pre>
  
  <p>Query:</p>
  
  <pre><code>session.query(User).options(subqueryload(User.addresses))
  </code></pre>
  
  <p>This will give me all addresses matching the join condition. However, what if I want to further filtering on the addresses. For example, if the user is logged in as a guest, he/she should only see another user's company address, but not his/her home address. So something like (hypothetically):</p>
  
  <pre><code>if user_group == 'guest':
      option = subqueryload(User.addresses).filter(Address.type != 'home')
  else:
      option = subqueryload(User.addresses)
  q = session.query(User).options(options)
  </code></pre>
  
  <p>This cannot be expressed as a condition in the primaryjoin or secondaryjoin. What should I do in this case?</p>
  
  <p>Thanks,</p>