pythondjango-rest-frameworklistfield

How to pass multiple values for a ListField in Django Rest Framework?


I want to use a ListField in one of my serializers. However, I can't figure out how to pass multiple values for such fields via a Browsable API form. I've tried using "value1, value2" or [value1, value2] but nothing seems to work. Any help?


Solution

  • The Browsable API doesn't support submitting multiple values for a ListField via an HTML form at the moment. There's an open pull request to address this issue. In the meantime, you can use the 'Raw data' tab to submit the values as JSON data.