import datetime

from sqlalchemy.schema import Column
from sqlalchemy.types import DateTime, Integer

from sqlalchemy.ext.declarative import declarative_base, declared_attr


Base = declarative_base()


class BaseMixin:

    id = Column(Integer, primary_key=True)

    @declared_attr
    def __tablename__(cls):
        return cls.__name__.lower()


class TimestampMixin:

    created_at = Column(
        DateTime, nullable=False, default=datetime.datetime.now)
    updated_at = Column(DateTime)

@@ -1,16 +1,30 @@
+from datetime 
 import datetime%0A
@@ -404,25 +404,16 @@
  Column(
-%0A        
 DateTime
@@ -447,25 +447,16 @@
 atetime.
-datetime.
 now)%0A   
@@ -484,10 +484,33 @@
 DateTime
+, onupdate=datetime.now
 )%0A

Update updated time on update