[Fixed]-Django create date list from existing objects

1👍

✅

Extracting unique dates

instances = YourModel.objects.all()
unique_dates = list(set(map(lambda x: x.date.strftime("%Y-%m-%d"), instances)))

About listing them, your url pattern looks ok. You need to define a view in order to retrieve them and wire up with that url.

UPDATE:

If you want to order them, just:

sorted_dates = sorted(unique_dates)

Leave a comment