title: Is possible to create Column in SQLAlchemy which is going to be automatically populated with time when it inserted/updated last time?
body: <p>Is it possible to create Column in SQLAlchemy which is going to be automatically populated with time when it inserted/updated last time ?</p>
  
  <p>I created models, inherited from Base class</p>
  
  <pre><code>class Base(object):
      def __tablename__(self):
          return self.__name__.lower()
      id = Column(Integer, primary_key=True)
      last_time = Column(TIMESTAMP, server_default=func.now())
  
  Base = declarative_base(cls=Base)
  
  class EntityModel(Base):
      __tablename__ = 'entities'
      settlement_id = Column(Integer, ForeignKey('settlements.id'), nullable=False)
      type = Column(String(20), nullable=False)
      level = Column(Integer, nullable=False, default=0)
      energy = Column(Float, nullable=False, default=0)
      position_x = Column(Integer, default=0)
      position_y = Column(Integer, default=0)
  
      def __repr__(self):
          return "&lt;Entity('%s')&gt;" % (self.type)
  </code></pre>
  
  <p>Every time when I update EntityModel I want to the <code>last_time</code> be updated on <code>system function.now()</code>. I can do this on the database level with triggers but I would rather do on application level if is it possible.</p>