I have a table named location, and I want to get some data between two dates.
I use this:
location.objects.filter(time>start_data, time<end_data)
but I think maybe not right.
What can I do using django? Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
in addition to sushanath’s answer, you can also use the date range lookup
http://docs.djangoproject.com/en/dev/ref/models/querysets/#range