﻿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
6295	forloop internals should create a single context dictionary, rather than recreating it on each iteration	Ned Batchelder	nobody	"In this django-users thread (http://groups.google.com/group/django-users/browse_thread/thread/3c79d7e1df438c68) I asked how to make an iffirst tag.  My first attempt at the tag was to maintain state in the context['forloop'] dictionary.  I found that it isn't not maintained between iterations.  Malcolm chimed in with exactly the same intuition, and also found that it didn't work.

Looking at the code, there seems to be no good reason to re-make the dictionary each time.

This patch changes the code to keep the same dictionary for the life of the forloop, so that other tags can use the dictionary to maintain state.

I also added tests for forloop.first and forloop.last, which were never tested directly...

"		closed	Template system	dev		fixed			Unreviewed	1	0	0	0	0	0
