How to Save or Print the array field in Django using CreateView?

Hi PFB the code.

HTML with Array Field.

HTML and Model

Forms and Views

Please help me here. I want to convert this array field values into string with comma separated and then save in table.

I hope I will get resolution.

Thanks in Advance.

This problem is resolved.
We can write like this
skills = self.request.POST.getlist(‘skills[]’)
skills = ‘,’.join(skills)

Couple comments / suggestions for you:

  1. When you want to post code (and templates) here to get assistance, please do not post images or links to images. Post the code here, between lines consisting of three backtick (`) characters to maintain formatting. Images aren’t always readable to people on different devices.

  2. While you can do it the way you’ve shown, what you’ve shown in your resolution isn’t the “Django way” of handling something like this. This may not matter to you yet, but you will find things easier in the long run if you take the time now to learn how to fully take advantage of Django forms and formsets.


Thanks Ken

I will make sure from next time I will not use images with URLs. I will put the code with three backtick(`) lines.
And yes right now I am learning in future I will definitely take full advantage of Django forms.