title: django date filter gte and lte
body: <p>I need to find data within a certain set of parameters
  I am building a small booking system, that lets user see what vehicles are available for booking for their little safari trip.</p>
  
  <p>The system has bookings that have been entered previously or made previously by a client.</p>
  
  <p>If a booking's <code>pickup_date = 2011-03-01</code> and <code>dropoff_date = 2011-03-15</code> and I run a query with <code>pickup=2011-03-09</code> and <code>dropoff=2011-03-14</code> in my views as below, it doesn't return any results to see if a booking within that timeframe has been made.</p>
  
  <p><strong>views.py</strong> </p>
  
  <pre><code>def dates(request, template_name='groups/_dates.html'):
      pickup=request.GET.get('pickup','None');
      dropoff=request.GET.get('dropoff','None');
      order = Order.objects.filter(pick_up__lte=pickup).filter(drop_off__gte=dropoff)
  
      context = {'order':order,}
  
      return render_to_response(template_name,context,
          context_instance=RequestContext(request))
  </code></pre>
  
  <p>Any suggestions on how to do this?
  Or should I be looking at an alternate way of running this query?</p>