﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
30804	Minor issue in Chaining filters section in given example code	ArjunAriyil	nobody	"https://docs.djangoproject.com/en/2.2/topics/db/queries/

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."	Cleanup/optimization	closed	Documentation	2.2	Normal	invalid	Chaining filters		Unreviewed	0	0	0	0	1	0
