title: Error InvalidRequestError: SQL expression, column, or mapped entity expected using hybrid_property
body: <p>I have the following model class:</p>
  <pre><code>class ArticleOptionSetModel(db.Model):
      __tablename__ = 'sdt_articles_options_sets'
  
      id = db.Column(db.Integer, db.Sequence(&quot;sdq_articles_options_sets&quot;), primary_key=True)
      article_id = db.Column(db.Integer, db.ForeignKey('sdt_articles.id'), nullable=False)
      option_set_id = db.Column(db.Integer, db.ForeignKey('sdt_options_sets.id'), nullable=False)
      order_num = db.Column(db.Integer, nullable=False)
  
      def have_options(self, article_id) -&gt; int:
          result = db.session.query(func.count(ArticleOptionSetModel.id))\
                                    .join(OptionSetModel, ArticleOptionSetModel.option_set_id == OptionSetModel.id)\
                                    .filter(ArticleOptionSetModel.article_id == self.article_id)\
                                    .filter(OptionSetModel.option_type == OT_OPTION).one()
          if result[0] &gt; 0:
              return 1
          else:
              return 0
  </code></pre>
  <p>If I try to use this model in a join, and extract the field:</p>
  <pre><code>        result = db.session.query(ArticleModel.id,
                                    ArticleOptionSetModel.have_options)\
              .join(ArticleOptionSetModel, ArticleModel.id == ArticleOptionSetModel.article_id)
  
          return result.all()
  </code></pre>
  <p>I get this error:</p>
  <p>sqlalchemy.exc.InvalidRequestError: SQL expression, column, or mapped entity expected - got '1'</p>
  <p>where 1 is the value returned from my method.</p>
  <p>The 0 or 1 returned from the method should be considered as column result in the caller query.
  How it's possible to do so ?</p>