Mercurial > getan > getan
diff getan/project.py @ 413:a499441249af
Fixes sorting by day for templates.
* Adds a string attribute 'startisoday' to the Entry object, so it can
be used by jinja2's sort and groupby filters.
author | Bernhard Reiter <bernhard@intevation.de> |
---|---|
date | Wed, 03 May 2017 13:35:58 +0200 |
parents | 5f557bd2cfe0 |
children | a47c7c0e01ec |
line wrap: on
line diff
--- a/getan/project.py Wed May 03 12:59:37 2017 +0200 +++ b/getan/project.py Wed May 03 13:35:58 2017 +0200 @@ -4,6 +4,11 @@ # (c) 2008, 2009, 2010 by # Sascha L. Teichmann <sascha.teichmann@intevation.de> # Ingo Weinzierl <ingo.weinzierl@intevation.de> +# (c) 2017 by Intevation GmbH +# Authors: +# * Sascha L. Teichmann <sascha.teichmann@intevation.de> +# * Ingo Weinzierl <ingo.weinzierl@intevation.de> +# ' Bernhard Reiter <bernhard.reiter@intevation.de> # # This is Free Software licensed unter the terms of GPLv3 or later. # For details see LICENSE coming with the source of 'getan'. @@ -92,6 +97,11 @@ self.desc = desc self.workpackage = "-" + # we add this attribute for use in jinja2 templates, + # as filters like sort() or groupby() work only on attributes + # and sorting or grouping by day is common for reporting + self.startisoday = start.date().isoformat() + # carefully handle non unicode string # urwid seems to have some issue with plain str if self.desc and not isinstance(self.desc, unicode):