how to create serializer for an enum field in django rest framework

后端 未结 2 910
孤街浪徒
孤街浪徒 2021-02-13 23:36

i am writing an API in python django rest framework and i am stuck at creating a serializer field for an ENUM, how can i create a serializer field for an ENUM field. my model co

2条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-14 00:11

    The EnumChoiceField extension seems to work fine but does not correctly support the HTML support render of the REST Framework, fields serialized as EnumChoiceField are not rendered.

提交回复
热议问题