title: flask sqlalchemy execute method every time object is updated
body: <p>what is the method name that gets executed every time a member of a class is updated?</p>
  
  <p>for example, <strong>init</strong> is run when an object is instantiated:</p>
  
  <pre><code>class Foo(db.Model)
      id = db.Column(db.Integer, primary_key=True)
      description = db.Column(db.String(50))
  
      def __init__(self, description):
          self.description = description
  </code></pre>
  
  <p>i would like to add a method to this class that runs every time i update a Foo object.</p>
  
  <p>after reading up on python classes here:</p>
  
  <p><a href="http://www.rafekettler.com/magicmethods.html" rel="nofollow">http://www.rafekettler.com/magicmethods.html</a></p>
  
  <p>i thought that the method i was looking for would look something like the below (but haven't gotten it working yet):</p>
  
  <pre><code>class Foo(db.Model)
      id = db.Column(db.Integer, primary_key=True)
      description = db.Column(db.String(50))
  
      def __init__(self, description):
          self.description = description
  
      def __call__(self, description):
          print 'obj is getting updated!'
          self.description = description
  </code></pre>
  
  <p>thanks for the help!</p>