Saturday, May 29, 2010

Query Posts By Date


I'm (almost) done coding up my blog in Django.

Right now I'm working to implement a search by date function. So my
class Post has a DateTimeField() called publish_date.

For the date search, I want to put two dropdown boxes on the web-page
so the users can pick a Month and Year and then it will show all posts
from that month and year.

The trouble is... how I translate the selections from the listboxes
(i.e. May 2010) into a DateTimeField() so I can search for all the
posts from that month and year?

Or am I going about this all wrong?

Thanks for the help in advance

You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

No comments:

Post a Comment