Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class MyBase(Base):
- created = Column(DateTime, nullable=False)
- def __init__(self):
- self.created = datetime.datetime.now()
- class User(MyBase):
- __tablename__ = 'user'
- id = Column(Integer, primary_key=True)
- email = Column(String(64), nullable=False, unique=True)
- password = Column(String(128), nullable=False)
- def __init__(self, email, password):
- self.email = email
- self.password = password
- super.__init__(self) # I know this isn't the right syntax, but still.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement