Skip to content

Instantly share code, notes, and snippets.

View medwig's full-sized avatar
✌️
Data contractor, ex-Faire, ex-Facebook

Jonathan Medwig medwig

✌️
Data contractor, ex-Faire, ex-Facebook
  • Faire
  • Kitchener, Canada
View GitHub Profile
@medwig
medwig / enum_attribute_pynamodb.py
Last active May 14, 2024 15:55
An enumerated type (enum) attribute for pynamodb
from pynamodb.models import Model
from pynamodb.constants import STRING
from pynamodb.attributes import UnicodeAttribute
ENUM = ('FOO', 'BAR', 'BAZ')
class EnumUnicodeAttribute(UnicodeAttribute):
"""
An enumerated unicode attribute