[Answer]-JSON value to django_enumfield value

1👍

So you want to look up the dictionary’s key by its value like so:

In [1]: UserGenderType.labels.keys()[UserGenderType.labels.values().index('Male')]                                                                            
Out[1]: 1

Leave a comment