With the latest changes in restframework 3.15.0 (Release notes), it looks like the get_choices field in converter.py file is broken when provided with integer choices. I looked into it and the cause was that rest-framework is no longer using OrderedDict, and instead providing a regular dict, which causes the current code to miss the following if statement:
if isinstance(choices, OrderedDict):
choices = choices.items()
Simply switching OrderedDict to dict should suffice and be retro-compatible, since an OrderedDict is ultimately a dictionary. I have tested this change and it works.
With the latest changes in restframework 3.15.0 (Release notes), it looks like the
get_choices
field inconverter.py
file is broken when provided with integer choices. I looked into it and the cause was that rest-framework is no longer usingOrderedDict
, and instead providing a regulardict
, which causes the current code to miss the following if statement:Simply switching
OrderedDict
todict
should suffice and be retro-compatible, since anOrderedDict
is ultimately a dictionary. I have tested this change and it works.