How about: items = Item.objects.filter(categories=category, expire_date__gt=today)
? Todd On Sun, Feb 1, 2009 at 2:04 PM, KJ <[email protected]> wrote: > > Hi, I want to filter objects based on whether they have expired or > not. Each object has an expiration date. Right now, I am getting all > the objects via this line: > items = Item.objects.filter(categories=category) > > However, I only want to get the "items" which have not expired > (expire_date > today). How can I add that check to the filter command? > > I recently started with Django, so be kind :) > > KJ > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected] 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 -~----------~----~----~----~------~----~------~--~---

