Skip to content

Instantly share code, notes, and snippets.


Mike Birtwell mbirtwell

  • London, UK
View GitHub Profile
mbirtwell / gist:aaccdb7972e1a7ed094b
Last active Dec 21, 2017
SQLAlchemy Enum recipe enhanced for use in postgresql arrays
View gist:aaccdb7972e1a7ed094b
# Based on
import six
from sqlalchemy.dialects import postgresql
from sqlalchemy.types import SchemaType, TypeDecorator, Enum
from sqlalchemy import __version__, text, cast
import re
if __version__ < '0.6.5':
raise NotImplementedError("Version 0.6.5 or higher of SQLAlchemy is required.")
You can’t perform that action at this time.