2008/9/12 Dana <[EMAIL PROTECTED]>:
>
> Hey all,
>
> Wondering what the best technique would be to make sure that an entry
> (such as a blog entry/story/etc...) with a datetime object 'pub_date'
> does not show up on the front end if the pub_date is in the future. I
> would assume using ".filter(...something...)" is the way to go but
> what would be the best filter to apply? Any other ways to achieve
> this?

Yes, a filter is a good option. For example:

from datetime import datetime

.objects.filter(pub_date__lte=datetime.now())

Regards.

-- 
Marcelo Ramos

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to