﻿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
10466	Document that functions in QuerySets' parameters are eagerly evaluated.	liangent	nobody	"if i write code like this:
{{{
qs = MyModel.objects.filter(dt__lte=datetime.datetime.now)
}}}
and execute it at time A, then save {{{ qs }}} somewhere.

later, at time B, i call {{{ for obj in qs }}} to get the object list. as the documentation says, database query is executed at time B. however, it seems that the value of {{{ dt__lte }}} was fetched at time A (ie. {{{ datetime.datetime.now }}} was evaluated at time A), and i think {{{ datetime.datetime.now }}} should be evaluated at time B (if i wrote
{{{
qs = MyModel.objects.filter(dt__lte=datetime.datetime.now())
}}}
, it should be evaluated at time A). it seems to go against ""QuerySets are lazy"", doesn't it?"	Cleanup/optimization	closed	Documentation	dev	Normal	duplicate		liangent@…	Accepted	0	0	0	0	0	0
