From 28fe1b8fba3e8389219c15c399437d42669bf453 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Wed, 14 Mar 2007 21:18:27 +0000 Subject: [PATCH] Usar list comprehension en vez de filter(). --- sercom/subcontrollers/enunciado/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sercom/subcontrollers/enunciado/__init__.py b/sercom/subcontrollers/enunciado/__init__.py index a81c9e3..9ef523f 100644 --- a/sercom/subcontrollers/enunciado/__init__.py +++ b/sercom/subcontrollers/enunciado/__init__.py @@ -178,8 +178,8 @@ class EnunciadoController(controllers.Controller, identity.SecureResource): def edit(self, id, **kw): """Edit record in model""" r = validate_get(id) - r.tareas_fuente = [{"id":t.id, "label":t.shortrepr()} for t in filter(lambda x: isinstance(x, TareaFuente), r.tareas)] - r.tareas_prueba = [{"id":t.id, "label":t.shortrepr()} for t in filter(lambda x: isinstance(x, TareaPrueba), r.tareas)] + r.tareas_fuente = [{"id":t.id, "label":t.shortrepr()} for t in r.tareas if isinstance(t, TareaFuente)] + r.tareas_prueba = [{"id":t.id, "label":t.shortrepr()} for t in r.tareas if isinstance(x, TareaPrueba)] return dict(name=name, namepl=namepl, record=r, form=form) @validate(form=form) -- 2.43.0