From d6936d4ebfec272318d768e7caf7ac57499e4d0d Mon Sep 17 00:00:00 2001 From: Sesostris Vieira Date: Tue, 9 Oct 2012 13:38:48 +0000 Subject: [PATCH] Garantir que as perguntas saiam sempre em ordem de 'title' --- sigi/apps/diagnosticos/models.py | 1 + 1 file changed, 1 insertion(+) diff --git a/sigi/apps/diagnosticos/models.py b/sigi/apps/diagnosticos/models.py index 59deb1a..9f9593a 100644 --- a/sigi/apps/diagnosticos/models.py +++ b/sigi/apps/diagnosticos/models.py @@ -120,6 +120,7 @@ class Diagnostico(BaseEntity): schemas = super(Diagnostico,self).get_schemata(*args, **kwargs) if category: schemas = [s for s in schemas if s.categoria_id == category] + schemas= sorted(schemas, lambda x,y: cmp(x.title, y.title)) return schemas