We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5e63e05 commit 248afdbCopy full SHA for 248afdb
extras_mongoengine/fields.py
@@ -75,7 +75,8 @@ class EnumField(object):
75
76
def __init__(self, enum, *args, **kwargs):
77
self.enum = enum
78
- kwargs['choices'] = [choice for choice in enum]
+ if 'choices' not in kwargs:
79
+ kwargs['choices'] = [(c.value, c.name) for c in enum]
80
super(EnumField, self).__init__(*args, **kwargs)
81
82
def __get_value(self, enum):
0 commit comments