Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.52 KB | None | 0 0
  1. class MyBase(Base):
  2.     created = Column(DateTime, nullable=False)
  3.  
  4.     def __init__(self):
  5.         self.created = datetime.datetime.now()
  6.  
  7. class User(MyBase):
  8.     __tablename__ = 'user'
  9.     id = Column(Integer, primary_key=True)
  10.     email = Column(String(64), nullable=False, unique=True)
  11.     password = Column(String(128), nullable=False)
  12.  
  13.     def __init__(self, email, password):
  14.         self.email = email
  15.         self.password = password
  16.         super.__init__(self) # I know this isn't the right syntax, but still.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement