Closed UnLuckyAki closed 6 months ago
@UnLuckyAki why don't you send it as {tags: ["house", "home", "flat"]}
? This is an API call right? You can send via a list.
@rtpg,
Thanks for the answer! It clarified me some questions.
I was careless when reading the documentation, assuming that string values should be processed in the same way as in FormField.
I also didn't use RAW requests, but the Web browsable API, which worked fine with one tag, but couldn't handle with several.
And finally, I sent form-data in Postman, but did it incorrectly, wrong way:
tags: ["house", "home", "flat"]
right way:
tags: "house"
tags: "home"
tags: "flat"
Tried to use the API to create new tags with request:
tags: house, home, flat
The problem is thatTagListSerializerField(serializers.ListField)
is converting this tags to['house, home, flat']
, soto_internal_value
method proceed it like a single tag, which returns it as"tags": ["house, home, flat"]
. Maybe I do sometthing wrong and will be gratefull for guidance. For now solved this with temporary fix (for comma only) into_internal_value
: