querying for timestamp field in django

Posted by Hulk on Stack Overflow See other posts from Stack Overflow or by Hulk
Published on 2010-05-05T08:58:23Z Indexed on 2010/05/05 9:18 UTC
Read the original article Hit count: 341

In my views i have the date in the following format s_date=20090106 and e_date=20100106

The model is defined as

     class Activity(models.Model):
          timestamp = models.DateTimeField(auto_now_add=True)

how to query for the timestamp filed with the above info.

   Activity.objects.filter(timestamp>=s_date and timestamp<=e_date)

Thanks.....

© Stack Overflow or respective owner

Related posts about django

Related posts about django-views