X-Git-Url: https://git.llucax.com/z.facultad/75.52/sercom.git/blobdiff_plain/86a6062b45b773ee18843a922ac7c07a11b1fa37..bcb3e4bcc3dfbface661034e16a86c69d4218d74:/sercom/subcontrollers/curso/__init__.py diff --git a/sercom/subcontrollers/curso/__init__.py b/sercom/subcontrollers/curso/__init__.py index d73b01b..699bc79 100644 --- a/sercom/subcontrollers/curso/__init__.py +++ b/sercom/subcontrollers/curso/__init__.py @@ -10,13 +10,14 @@ from turbogears import identity from turbogears import paginate from docutils.core import publish_parts from sercom.subcontrollers import validate as val -from sercom.model import Curso, Correccion, Ejercicio, Alumno, Docente, Grupo, DocenteInscripto +from sercom.model import Curso, Correccion, Ejercicio, Alumno, Docente, Grupo, DocenteInscripto, Rol from curso_alumno import * from sqlobject import * from sqlobject.dberrors import * from sercom.widgets import * from alumno import AlumnoInscriptoController from grupo import GrupoController +from ejercicio import EjercicioController #}}} #{{{ Configuración @@ -163,6 +164,7 @@ class CursoController(controllers.Controller, identity.SecureResource): curso_alumno = CursoAlumnoController() alumno = AlumnoInscriptoController() grupo = GrupoController() + ejercicio = EjercicioController() @expose() def default(self, tg_errors=None): @@ -177,7 +179,7 @@ class CursoController(controllers.Controller, identity.SecureResource): @paginate('records') def list(self): """List records in model""" - r = cls.select() + r = cls.select().orderBy((-cls.q.anio, -cls.q.cuatrimestre, cls.q.numero)) return dict(records=r, name=name, namepl=namepl) @expose() @@ -298,7 +300,7 @@ class CursoController(controllers.Controller, identity.SecureResource): if row == []: continue try: - u = Alumno(row[0], nombre=row[1]) + u = Alumno(row[0], nombre=row[1], roles=[Rol.by_nombre('alumno')]) except: u = Alumno.byPadron(row[0]) try: