import inspect
from enum import Enum


class ChoiceEnum(Enum):
    @classmethod
    def choices(cls):
        # get all members of the class
        members = inspect.getmembers(cls, lambda m: not(inspect.isroutine(m)))
        # filter down to just properties
        props = [m for m in members if not(m[0][:2] == '__')]
        # format into django choice tuple
        choices = tuple([(str(p[1].value), p[0]) for p in props])
        return choices

@@ -447,8 +447,147 @@
 choices%0A
+%0A    @classmethod%0A    def get(cls, key, default=None):%0A        try:%0A            return cls%5Bkey%5D%0A        except:%0A            return default%0A

add get function class on base enums