In the **Chaining filters** section,
"pub_date_**_gte**=datetime.date.today()" needs to be replaced with
"pub_date_**_lte**=datetime.date.today() to get entries published between
January 30, 2005, and the current day.
----
== Chaining filters
The result of refining a QuerySet is itself a QuerySet, so it’s possible
to chain refinements together. For example:
{{{
>>> Entry.objects.filter(
... headline__startswith='What'
... ).exclude(
... pub_date__gte=datetime.date.today()
... ).filter(
... pub_date__gte=datetime.date(2005, 1, 30)
... )
}}}
This takes the initial QuerySet of all entries in the database, adds a
filter, then an exclusion, then another filter. The final result is a
QuerySet containing all entries with a headline that starts with “What”,
that were published between January 30, 2005, and the current day.
--
Ticket URL: <https://code.djangoproject.com/ticket/30804>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by Nicolas Pantel):
There is no issue.
The first filter excludes entries published after today, then the second
keep entries published after January 30, 2005.
The result are the entries published between January 30, 2005 and today,
as stated.
--
Ticket URL: <https://code.djangoproject.com/ticket/30804#comment:1>
* status: new => closed
* resolution: => invalid
--
Ticket URL: <https://code.djangoproject.com/ticket/30804#comment:2>