Guest User

Untitled

a guest
Jun 20th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. class User(declarative_base()):
  2. __tablename__ = 'users'
  3.  
  4. id = Column(Integer, primary_key=True)
  5. name = Column(String)
  6.  
  7. def __init__(self, name):
  8. self.name = name
  9.  
  10. def to_dict(self):
  11. return dict([(k, getattr(self, k)) for k in self.__dict__.keys()])
Add Comment
Please, Sign In to add comment