title: How to add count condition on relationship in hybrid property expression?
body: <p>I have these models as an example:</p>
  <pre class="lang-py prettyprint-override"><code>class Parent(db.Model):
      __tablename__ = 'parents'
  
      parent_id = db.Column(db.Integer, primary_key=True)
      children = db.relationship('Child', lazy='dynamic')
  
  class Child(db.Model):
      __tablename__ = 'children'
  
      child_id = db.Column(db.Integer, primary_key=True)
      parent_id = db.Column(db.ForeignKey(&quot;parents.parent_id&quot;))
  </code></pre>
  <p>Now I'd like to create a hybrid property expression for the <code>Parent</code> model so I can query on it later:</p>
  <pre class="lang-py prettyprint-override"><code>@hybrid_property
  def is_parent_of_multiple_children(self):
      return self.children.count() &gt; 2
  
  @is_parent_of_multiple_children.expression     
  def is_parent_of_multiple_children(cls):
    return (
        ???
    )
  </code></pre>
  <p>I reckon this is how I do it in native SQL (MySQL in my case):</p>
  <pre class="lang-sql prettyprint-override"><code>select parents.parent_id as ID
  from children join parents on children.parent_id = parents.parent_id
  group by ID
  having count(ID) &gt; 2
  </code></pre>
  <p>Should I implement this with <code>sqlalchemy.select</code> and do the <code>join</code> the same way? I have <code>cls.children</code> which would suggest I have some way to use <code>func.count</code> or something similar instead of implementing tedious native SQL logic.</p>