Advertisement
Guest User

Untitled

a guest
Mar 19th, 2021
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.66 KB | None | 0 0
  1. from datetime import datetime, timedelta
  2. from django.views.decorators.http import require_http_methods
  3. from django.shortcuts import render
  4.  
  5.  
  6. @require_http_methods(['GET'])
  7. def response_template(request):
  8.     start_date = datetime.now()
  9.     end_date = start_date + timedelta(days=4)
  10.        
  11.     context = {
  12.         'bookings': Booking.objects.filter(
  13.             organization_id=request.user.organization_id,
  14.             booking_time__date__range=(start_date.date(), end_date.date())
  15.         ),
  16.         'office': Office.objects.filter(organization_id__exact=request.user.organization_id)
  17.     }
  18.  
  19.     return render(request, 'overview/overview.html', context)
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement