Reputation: 13
I want to print list as a separate strings in html
For example: ['one','two','three']
output- one,two,three
for loop didn't work it prints one letter per line instead one item
I tried slugify but it ads dashes
{{item.notes|slugify}}
Upvotes: 1
Views: 711
Reputation: 69755
If I am guessing correctly, you want to join each element of the list with a comma, assuming your list is stored in value
, use the following:
{{ value|join:"," }}
The output will be:
one,two,three
Upvotes: 2