title: Detaching SQLAlchemy instance so no refresh happens
body: <p>I want to detach an instance of a class from my session but it should still be available for reading (without emitting a query). I have been scanning through the documentation for days now, but every approach I try leads to the message</p>
  
  <pre><code>DetachedInstanceError: Instance &lt;MyModel at 0x36bb190&gt; is not bound to a Session;
  attribute refresh operation cannot proceed
  </code></pre>
  
  <p>I am working with the <code>zope.sqlalchemy</code> transaction manager in Pyramid. I want my object to be usable <strong>after</strong> the transaction has been committed. I only need it to read the "cached" value, i.e. those that were in it before the transaction was commited.</p>
  
  <p>The only possible solution I could find was to wrap the class (or the attributes itself) and then track the changes manually (I could do that but it is really ugly and not at all Pythonic).</p>
  
  <p>Is there a way I can prevent SQLAlchemy from trying to refresh these values?</p>
  
  <p>As a fallback I would even be open to just returning <code>None</code>, as long as the above error doesn't get thrown after the transaction as been committed</p>