I am trying to solve an issue with getting all dates within a range into my Django application template. I have a start date and an end date of a time sheet which are defined and I am able to pass them into the template. However, I want to fill in all of the dates in between into an HTML table but cannot seem to find a solution to this problem, as most solutions are for 1 date only. Any and all help is greatly appreciated!
views.py
def time_page(request, result_name):
records = TimeSheetMain.objects.get(timeSheet_code=result_name)
empID = Employee.objects.get()
req_user = request.user
recordsUser = records.user
if req_user == recordsUser:
return render_to_response('ts.html',
{'records': records, 'empID': empID},
context_instance=RequestContext(request))
HTML Call:
Date Range: {{ records.startDate }} - {{ records.endDate }}
urls.py
url(r'^ts/(.{36})', 'TimeSheetApp.views.time_page', name="time_page"),