class ExampleViewSet(PartialUpdateModelMixin, viewsets.ReadOnlyModelViewSet):
...
@action(detail=False, methods=["GET"], url_path="_meta")
def api_meta(self, request):
meta = {
"fields": {
"types": {
"choices": Example.ExampleType.choices
},
"method": {
"choices": Example.ExampleMethod.choices
}
}
}
return Response(meta)
In this example, our model have a "types" field, it's an array.