Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from datetime import datetime, timedelta
- from django.views.decorators.http import require_http_methods
- from django.shortcuts import render
- @require_http_methods(['GET'])
- def response_template(request):
- start_date = datetime.now()
- end_date = start_date + timedelta(days=4)
- context = {
- 'bookings': Booking.objects.filter(
- organization_id=request.user.organization_id,
- booking_time__date__range=(start_date.date(), end_date.date())
- ),
- 'office': Office.objects.filter(organization_id__exact=request.user.organization_id)
- }
- return render(request, 'overview/overview.html', context)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement