title: Elixir Event Handler
body: <p>I want to use the @after_insert decorator of Elixir, but i can't access the Session within the model. Since i have autocommit set to False, i can't commit any changes in the event handler. Is there any best practice how to deal with that?</p>
  
  <p>The Code I used to build model, database connection etc. are mostly taken off the documentations.</p>
  
  <p>The desired method:</p>
  
  <pre><code>class Artefact(Entity):
  [...]
      @after_insert
      def make_signature(self):
          self.signature = '%s-%s' % (self.artefact_type.title.upper()[:3], self.id)
  </code></pre>
  
  <p>All the Session initialization is done in the <strong>init</strong>.py in the same directory.</p>
  
  <p>When I then call:</p>
  
  <pre><code>Session.update(self)
  Session.commit()
  </code></pre>
  
  <p>I get an error that Session is undefined.
  Any idea?</p>