title: SQLAlchemy: how to perform regexp_replace on column values
body: <p>I am trying to do the equivalent of 
  <code>cast(regexp_replace(entry.page_title,'.*::: ','') AS INT)</code> using SQLAlchemy. </p>
  
  <p>I've seen that you can use <a href="http://docs.sqlalchemy.org/en/rel_0_9/orm/extensions/hybrid.html" rel="noreferrer">hybrid properties</a> to perform functions on ORM-mapped classes.
  I've tried the following but I can't really see how you can use the hybrid properties to do string replace. </p>
  
  <pre><code>class Entry(object):
  
      def __init__(self, page_title):
          self.page_title = page_title
  
      @hybrid_property
      def original_brand_id(self):
          return self.page_title.partition(' ::: ')[-1]
          ###OR ALSO TRIED DOING:
          return re.sub(r'[.*::: ]','',self.page_title)
  </code></pre>
  
  <p>I know that the issue is that I'm wanting to treat Entry's page_title as a <code>string</code> when it's actually an <code>InstrumentedAttribute</code>. But I'm not clear on how to get the string value, to get this to do what I want. </p>
  
  <p>Is it even possible?</p>