Don't use `itertools.groupby` in templates, as it may leak.
Related to #6614 and #G190.
Authored by: cboos 2008-03-04
Parent: [r6636]
Child: [r6638]