Skip to content

Instantly share code, notes, and snippets.

@novaleksey
novaleksey / peewee_enum.py
Last active August 13, 2024 20:54
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: