I have a list with dates in it.
event_labels = []
for item in all_list:
event_labels.append(str(item.event_created_at))
context['graph_data_labels'] = json.dumps(event_labels)
"['2018-05-18', '2018-05-17', '2018-05-16', '2018-05-15', '2018-05-14', '2018-05-13', '2018-05-12', '2018-05-11']"
I am using this data to output for labels in chartjs. Problem is the sourrounding double quotes around the event_labels list.
I have another list with just integers and it does not have the sourrounding quotes around the beginning and the end of the list.
[26.0, 50.0, 27.0, 87.0, 46.0, 24.0, 18.0, 34.0]
How do I output a string list without the double quotes at the beginning and end?
In the frontend HTML its like this:
<div>[26.0, 50.0, 27.0, 87.0, 46.0, 24.0, 18.0, 34.0]</div>
<div>"['2018-05-18', '2018-05-17', '2018-05-16', '2018-05-15', '2018-05-14', '2018-05-13', '2018-05-12', '2018-05-11']"</div>
Problem is in the console or if I just print it, I dont see the "
So the output that I want is:
<div>['2018-05-18', '2018-05-17', '2018-05-16', '2018-05-15', '2018-05-14', '2018-05-13', '2018-05-12', '2018-05-11']</div>