bckohan / django-enum

Full and natural support for enumerations as Django model fields.
https://django-enum.rtfd.io
MIT License
40 stars 1 forks source link

EnumField's should inherit from common base titled EnumField #46

Closed bckohan closed 1 month ago

bckohan commented 1 year ago

Right now to determine if a field is an EnumField the best option is to do something like:


from django_enum.fields import EnumMixin

isinstance(Model._meta.get_field('field'), EnumMixin)

This is not documented and not intuitive given that EnumFields are defined as EnumField. Should be able to make this test with EnumField rather than EnumMixin.