Skip to content

Instantly share code, notes, and snippets.

@reedobrien
Created November 7, 2010 03:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reedobrien/665940 to your computer and use it in GitHub Desktop.
Save reedobrien/665940 to your computer and use it in GitHub Desktop.
maybe a method to ease sa with deform
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()])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment