﻿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
3481	request: else part for a for loop or make if to create variable	jimmy@…	Adrian Holovaty	"When using the object_detail generic view:

If you have for examle a blog entry Entry(), and comments Comment() on it;
I would use this to loop for comments:

{{{
{% for comment in object.comment_set.all %}
   {{ comment.body_text }}
   <hr>
{% endfor%}
}}}

Now the problem is; it is impossible to display something in case there are no comments without hitting the database again.

It could be fixed with an '{% elsefor %}' or by making it possible to assign object.comment_set.all to some var once.

Another solution would be to make '{% if object.comment_set_all %}' create a variable 'if.result' or something.
"		closed	Template system			wontfix	for if else loop		Design decision needed	0	0	0	0	0	0
