From: Ricardo Markiewicz Date: Sun, 11 Mar 2007 17:33:39 +0000 (+0000) Subject: Agrego MisCorrecciones X-Git-Tag: 0_9~74 X-Git-Url: https://git.llucax.com/software/sercom.git/commitdiff_plain/46330cba9a5e12187591e83ce195042c0e10ce55?ds=sidebyside Agrego MisCorrecciones Es una simple lista donde uno puede ver las correcciones de los TPs. --- diff --git a/sercom/controllers.py b/sercom/controllers.py index fe303b8..160d207 100644 --- a/sercom/controllers.py +++ b/sercom/controllers.py @@ -130,6 +130,8 @@ class Root(controllers.RootController): mis_entregas = MisEntregasController() + mis_correcciones = MisCorreccionesController() + #{{{ Agrega summarize a namespace tg de KID def summarize(text, size, concat=True, continuation='...'): """Summarize a string if it's length is greater than a specified size. This diff --git a/sercom/subcontrollers/__init__.py b/sercom/subcontrollers/__init__.py index 9b12669..20d7948 100644 --- a/sercom/subcontrollers/__init__.py +++ b/sercom/subcontrollers/__init__.py @@ -9,3 +9,4 @@ from grupo import GrupoController from correccion import CorreccionController from alumno_inscripto import AlumnoInscriptoController from misentregas import MisEntregasController +from miscorrecciones import MisCorreccionesController diff --git a/sercom/subcontrollers/miscorrecciones/__init__.py b/sercom/subcontrollers/miscorrecciones/__init__.py new file mode 100644 index 0000000..d75d62a --- /dev/null +++ b/sercom/subcontrollers/miscorrecciones/__init__.py @@ -0,0 +1,52 @@ +# vim: set et sw=4 sts=4 encoding=utf-8 foldmethod=marker : + +#{{{ Imports +import cherrypy +from turbogears import controllers, expose, redirect +from turbogears import validate, flash, error_handler +from turbogears import validators as V +from turbogears import widgets as W +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 Entrega, Correccion, Grupo, AlumnoInscripto +from sqlobject import * +from zipfile import ZipFile, BadZipfile +from cStringIO import StringIO + +#}}} + +#{{{ Configuración +cls = Correccion +name = 'correccion' +namepl = name + 'es' +#}}} + +#{{{ Controlador +class MisCorreccionesController(controllers.Controller, identity.SecureResource): + """Basic model admin interface""" + require = identity.has_permission('entregar') + + @expose() + def default(self, tg_errors=None): + """handle non exist urls""" + raise redirect('list') + + @expose() + def index(self): + raise redirect('list') + + @expose(template='kid:%s.templates.list' % __name__) + @paginate('records') + def list(self): + """List records in model""" + # Grupos en los que el usuario formo parte + m = [i.grupo.id for i in Grupo.selectByAlumno(identity.current.user)] + entregador = AlumnoInscripto.selectByAlumno(identity.current.user) + m.append(entregador.id) + r = cls.select(IN(cls.q.entregadorID, m)) + return dict(records=r, name=name, namepl=namepl) + +#}}} + diff --git a/sercom/subcontrollers/miscorrecciones/templates/__init__.py b/sercom/subcontrollers/miscorrecciones/templates/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/sercom/subcontrollers/miscorrecciones/templates/list.kid b/sercom/subcontrollers/miscorrecciones/templates/list.kid new file mode 100644 index 0000000..2a75a1c --- /dev/null +++ b/sercom/subcontrollers/miscorrecciones/templates/list.kid @@ -0,0 +1,43 @@ + + + + + +list + + + +

Mis Objetos

+ + + + + + + + + + + + + + + + + + + + +
EntregadorEjercicioIECorrectorFechaNotaObservaciones
usuariousuariousuariofecha asignadofecha corregidofecha corregidonota
+ +
+ ${page} + ${page} +
+ + + + +