title: How to filter an object based on a DateTimeField range in Python (Django) using Tastypie
body: <p>How can one filter an object based on a <strong>datetime field</strong> range using <strong>Tastypie</strong>.</p>
  
  <p>I have a <strong>Post model</strong>:</p>
  
  <pre><code>class Post(models.Model):
       title = models.CharField(max_length=40)
       postTime = models.DateTimeField(auto_now_add=True)
       description = models.CharField(max_length=140)
  </code></pre>
  
  <p>The post objects are retrieved through <strong>Tastypie</strong>. The range of objects I would like to retrieve are all the objects created from today to all the objects created 3 days ago. So I tried filtering the objects from the queryset as follows</p>
  
  <pre><code>RecentPosts(ModelResource):
       class Meta:
            queryset= Post.objects.filter(postTime__range=(date.today(), date.today() -timedelta(days=3)))
            resource_name = 'recent-posts'
            fields = ['id','postTime']
            authentication = BasicAuthentication()
            authorization =DjangoAuthorization()
            serializer = Serializer(formats=['json'])
            include_resource_uri = False
            filtering = {
                              'postTime': ALL,
                              'description': ALL,
            }
  </code></pre>
  
  <p>Even after doing this I'm unable to retrieve the objects. How else can I go about this?</p>