title: invalid filter: Only one property per query may have inequality filters (>=, <=, >, <)
body: <p>I have a number of items which are bookable in certain timeslots. Eg. a tennis court. So each item has got a number of associated availability slots each defined by begintime and endtime. Begintime and endtime are defined as datetime-objects so an availability slot from 09.00 - 11.30, is stored as eg. 2013-12-13 09.00 (begintime) to 2013-12-13 11.30 (endtime).</p>
  
  <p>When a booking request comes in, I need to find out whether the tennis court is available for the desired timeslot.</p>
  
  <p>So I am trying to filter availability slots based on start-time and end-time, and my query looks like this:</p>
  
  <pre><code>desired_availability_start = datetime(2013, 12, 13, 9,0,0)
  desired_availability_end = datetime(2013, 12, 13, 10,0,0)
  availability_slots = self.availability_slots.filter("begin &lt;= ", desired_availability_start).filter("end &gt;= ", desired_availability_end).fetch(limit=10)
  </code></pre>
  
  <p>but I get the following error</p>
  
  <pre><code>invalid filter: Only one property per query may have inequality filters (&gt;=, &lt;=, &gt;, &lt;)
  </code></pre>
  
  <p>Because I am trying to filter on both the begin- and end-property.</p>
  
  <p>Based on the input and from some of the other posts on the topic <a href="https://stackoverflow.com/questions/10809273/inequality-filter-in-appengine-datastore">Inequality Filter in AppEngine Datastore</a> and <a href="https://stackoverflow.com/questions/13391818/badfiltererror-invalid-filter-only-one-property-per-query-may-have-inequality">BadFilterError: invalid filter: Only one property per query may have inequality filters (&lt;=, &gt;=, &lt;, &gt;)</a> my current solution is to first filter on begin:</p>
  
  <pre><code>filtered_availability_slots = self.availability_slots.filter("begin &lt;= ", desired_availability_start).fetch(limit=10)
  </code></pre>
  
  <p>and then filter on end and append the filtered items to a list:</p>
  
  <pre><code>final_availability_slots = []              
    for availability in filtered_availability_slots:         
        if availability.end &gt;= desired_availability_end:  
          final_avaialability_slotes.append(availability)   
  </code></pre>
  
  <p>But is this the best way of achieving what I want to achieve? </p>
  
  <p>I am using Google App Engine and Python</p>
  
  <p>Any help is appreciated</p>
  
  <p>thanks
  Thomas</p>