Skip to content

Instantly share code, notes, and snippets.

@kaniak274
Created October 12, 2020 15:05
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 kaniak274/f11146ed7731933c96593c400fa5ec69 to your computer and use it in GitHub Desktop.
Save kaniak274/f11146ed7731933c96593c400fa5ec69 to your computer and use it in GitHub Desktop.
base_model.py (Medium article about enum)
class Status(Enum):
STARTED = 'STARTED'
ACCEPTED = 'ACCEPTED'
class Transaction(Base):
__tablename__ = 'transactions'
id = Column(Integer, primary_key=True)
status = Column(Enum(Status))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment