I'm trying to make a demo website for job applications using Angular 6 and Django Rest Framework. One of my application fields involve listing your interests in a chip input field like this one.
The JSON being sent to my API would look something like this:
{
...
'firstname': 'Firstname',
'lastname': 'Lastname'
...
'interests': ['hobby1', 'hobby2', 'hobby3', 'hobby4'],
...
}
Now as far as I know Django REST Framework supplies a serializer field that is written something like this:
interests = serializers.ListField(
item = serializers.CharField(min_value=xx, max_value=xx)
)
My question is, how do I proceed from here? What model fields do I use, or do I have to create my own save function that iterates through the interests and saves every single one?
that iterates through the interests and saves every single one, do you mean many2many relashion? or you just want save it as array?unique indexon both relation fields.