From 38ac44387bd58fc4e3a1956934f3ddb7f8dbd11f Mon Sep 17 00:00:00 2001 From: piernov Date: Sat, 28 Feb 2015 22:33:54 +0100 Subject: Replace 2 filter() by list comprehensions --- jm2l/templates/Interventions/Interventions.mako | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jm2l/templates/Interventions/Interventions.mako b/jm2l/templates/Interventions/Interventions.mako index 8877efc..f917e63 100644 --- a/jm2l/templates/Interventions/Interventions.mako +++ b/jm2l/templates/Interventions/Interventions.mako @@ -65,7 +65,7 @@ elif Type=='T':
Vos ${CurTitles} programmés pour 2015 <% -Selection = filter(lambda x:(x.event_type==CurEventType and x.for_year==2015), uprofil.events) +Selection = [ x for x in uprofil.events if (x.event_type==CurEventType and x.for_year==2015) ] HeadHistTitle = u"L'historique de vos %s ( %d ) " % ( CurTitles, len(Selection) ) NothingTitle = u"Vous n'avez pas sollicité d'intervention %s." % CurEvent %> @@ -224,7 +224,7 @@ NothingTitle = u"Vous n'avez pas sollicité d'intervention %s." % CurEvent
Historique <% -Selection = filter(lambda x:(x.event_type==CurEventType and x.for_year!=2015), uprofil.events) +Selection = [ x for x in uprofil.events if (x.event_type==CurEventType and x.for_year!=2015) ] HeadHistTitle = u"L'historique de vos %s ( %d ) " % ( CurTitles, len(Selection) ) NothingTitle = u"Désolé, Il n'y a rien dans l'historique vous concernant." %> -- cgit v1.2.3-70-g09d2