title: SqlAlchemy: Boolean value of this clause is not defined
body: <p>I'm having problems with SqlAlchemy as follows: A derived method, called <code>firstName_lastName_regular</code>, returns a hybrid property. But the <code>if</code> condition (which includes valid SqlAlchemy functions) throws</p>
  <pre><code>TypeError: Boolean value of this clause is not defined
  </code></pre>
  <p>Before returning I need to check if my components are not NULL and length &gt; 0. The line <code>if (func.charlength(first_name) &gt; 0 and func.charlength(last_name) &gt; 0)</code> is failing.</p>
  <pre><code>@hybrid_method
  def firstName_lastName_regular(self):
      first_name = self.get_first_name(self)
      last_name = self.get_last_name(self)
      result = ''
      if (func.charlength(first_name) &gt; 0 and func.charlength(last_name) &gt; 0):
          result = func.concat (
                  func.upper(func.substr(first_name,1,1)), func.lower(func.substr(first_name,2)), ' ',
                  func.upper(func.substr(last_name,1,1)), func.lower(func.substr(last_name,2))
                  )
      return result  
  </code></pre>