Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在django rest swagger中将枚举渲染为下拉列表_Django_Django Rest Framework_Django Rest Swagger - Fatal编程技术网

在django rest swagger中将枚举渲染为下拉列表

在django rest swagger中将枚举渲染为下拉列表,django,django-rest-framework,django-rest-swagger,Django,Django Rest Framework,Django Rest Swagger,我正在尝试获得由生成的swagger文档中显示的正确查询参数 但这不会显示为下拉列表 如何将选项呈现为下拉列表?试试: schema=coreschema.Enum( ('ONE', 'TWO'), title=force_text(self.key_title), description=force_text(self.key_description) ) schema=coreschema.Enum( ('ONE', 'TWO'), title=force_text(s

我正在尝试获得由生成的swagger文档中显示的正确查询参数

但这不会显示为下拉列表

如何将选项呈现为下拉列表?

试试:

schema=coreschema.Enum(
  ('ONE', 'TWO'),
  title=force_text(self.key_title),
  description=force_text(self.key_description)
)
schema=coreschema.Enum(
  ('ONE', 'TWO'),
  title=force_text(self.key_title),
  description=force_text(self.key_description)
)