Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class User(declarative_base()):
- __tablename__ = 'users'
- id = Column(Integer, primary_key=True)
- name = Column(String)
- def __init__(self, name):
- self.name = name
- def to_dict(self):
- return dict([(k, getattr(self, k)) for k in self.__dict__.keys()])
Add Comment
Please, Sign In to add comment