Skip to content

Instantly share code, notes, and snippets.

@novaleksey
novaleksey / peewee_enum.py
Last active January 30, 2022 20:05
Peewee 3 Enum Field Postgres
from peewee import *
database = PostgresqlDatabase(
'my_database',
**{'user': 'postgres', 'password': 'postgres', 'host': 'localhost', 'port': 5432, 'autorollback': True}
)
class BaseModel(Model):
class Meta: