docente_inscripto = DocenteInscriptoController()
- alumno_inscripto = AlumnoInscriptoController()
-
correccion = CorreccionController()
admin = identity.SecureObject(CatWalk(model), identity.has_permission('admin'))
from docente_inscripto import DocenteInscriptoController
from grupo import GrupoController
from correccion import CorreccionController
-from alumno_inscripto import AlumnoInscriptoController
from misentregas import MisEntregasController
from grupo_admin import GrupoAdminController
from miscorrecciones import MisCorreccionesController
from sqlobject import *
from sqlobject.dberrors import *
from sercom.widgets import *
+from alumno import AlumnoInscriptoController
#}}}
#{{{ Configuración
"""Basic model admin interface"""
require = identity.has_permission('admin')
curso_alumno = CursoAlumnoController()
+ alumno = AlumnoInscriptoController()
@expose()
def default(self, tg_errors=None):
def get_cursos():
return [(0, u'---')] + [(fk1.id, fk1.shortrepr()) for fk1 in Curso.select()]
-class AlumnoInscriptoFiltros(W.TableForm):
- class Fields(W.WidgetsList):
- cursoID = W.SingleSelectField(label=_(u'Curso'), options = get_cursos, validator = V.Int(not_empty=True))
- fields = Fields()
-
-filtro = AlumnoInscriptoFiltros()
form = AlumnoInscriptoForm()
#}}}
@paginate('records')
def list(self, cursoID = 0):
"""List records in model"""
- vfilter = dict(cursoID = cursoID)
- if int(cursoID) == 0:
- r = cls.select()
+ cursoID = int(cursoID)
+ if cursoID == 0:
+ raise redirect('..')
else:
r = cls.select(cls.q.cursoID == cursoID)
- return dict(records=r, name=name, namepl=namepl, form=filtro, vfilter=vfilter)
+ return dict(records=r, name=name, namepl=namepl, cursoid=cursoID)
@expose(template='kid:%s.templates.notas' % __name__)
- def notas(self, id, **kw):
+ def notas(self, id, cursoID, **kw):
"""Edit record in model"""
+ cursoID = int(cursoID)
r = validate_get(id)
- return dict(name=name, namepl=namepl, record=r, form=form)
+ return dict(name=name, namepl=namepl, record=r, form=form, cursoid=cursoID)
@validate(form=form)
@error_handler(notas)
@expose()
- def update(self, id, **kw):
+ def update(self, id, cursoID, **kw):
"""Save or create record to model"""
+ cursoID = int(cursoID)
r = validate_set(id, kw)
flash(_(u'El %s fue actualizado.') % name)
- raise redirect('../list')
+ raise redirect('../list/%d' % cursoID)
@expose(template='kid:%s.templates.show' % __name__)
- def show(self,id, **kw):
+ def show(self,id,cursoID, **kw):
"""Show record in model"""
+ cursoID = int(cursoID)
r = validate_get(id)
- return dict(name=name, namepl=namepl, record=r)
+ return dict(name=name, namepl=namepl, record=r, cursoid=cursoID)
#}}}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?python from sercom.model import Grupo, AlumnoInscripto ?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://purl.org/kid/ns#"
- py:extends="'../../../templates/master.kid'">
+ py:extends="'../../../../templates/master.kid'">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" py:replace="''"/>
<title>list</title>
</head>
<body>
-<h1>Administración de <span py:replace="namepl">Objetos</span></h1>
-
-<div py:replace="form(value=vfilter, action=tg.url('/alumno_inscripto/list'), submit_text=_(u'Filtrar'))">Filtros</div>
+<h1>Alumnos</h1>
<table class="list">
<tr>
</tr>
<tr py:for="record in records">
<td><a href="${tg.url('/curso/show/%d' % record.curso.id)}" py:content="record.curso.shortrepr()">curso</a></td>
- <td><a href="${tg.url('/alumno/show/%d' % record.alumno.id)}" py:content="record.alumno.shortrepr()">alumno</a></td>
+ <td><a href="${tg.url('/curso/alumno/show/%d' % record.alumno.id)}" py:content="record.alumno.shortrepr()">alumno</a></td>
<td><span py:replace="record.condicional">fecha corregido</span></td>
<td><a py:if="record.tutor" href="${tg.url('/docente/show/%d' % record.tutor.id)}" py:content="record.tutor.shortrepr()">Tutor</a></td>
<td>
- <a href="${tg.url('/alumno_inscripto/show/%d' % record.id)}">Ver</a>
- <a href="${tg.url('/alumno_inscripto/notas/%d' % record.id)}">Notas</a>
+ <a href="${tg.url('/curso/alumno/notas/%d/%d' % (record.id, cursoid))}">Notas</a>
</td>
</tr>
</table>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://purl.org/kid/ns#"
- py:extends="'../../../templates/master.kid'">
+ py:extends="'../../../../templates/master.kid'">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" py:replace="''"/>
<title>show</title>
</table>
<br/>
-<a href="${tg.url('/alumno/edit/%d' % record.id)}">Editar</a> |
-<a href="${tg.url('/alumno/list')}">Volver</a>
+<a href="${tg.url('/curso/alumno/list')}">Volver</a>
</body>
</html>
<td><span py:replace="record.anio">anio</span></td>
<td><span py:replace="record.descripcion">descripcion</span></td>
<td><a py:if="len(record.docentes)" href="${tg.url('/docente/list')}"><span py:replace="len(record.docentes)">Docentes</span></a></td>
- <td><a py:if="len(record.alumnos)" href="${tg.url('/alumno_inscripto/list/%d' % record.id)}"><span py:replace="len(record.alumnos)">Alumnos</span></a></td>
+ <td><a py:if="len(record.alumnos)" href="${tg.url('/curso/alumno/list/%d' % record.id)}"><span py:replace="len(record.alumnos)">Alumnos</span></a></td>
<td><a py:if="len(record.grupos)" href="${tg.url('/grupo/list/%d' % record.id)}"><span py:replace="len(record.grupos)">Grupos</span></a></td>
<td><a py:if="len(record.ejercicios)" href="${tg.url('/ejercicio/list')}"><span py:replace="len(record.ejercicios)">Ejercicio</span></a></td>
<td><a href="${tg.url('/curso/show/%d' % record.id)}">Ver</a>
<th>Integrantes:</th>
<td>
<span py:for="a in record.miembros">
- <a href="${tg.url('/alumno_inscripto/show/%d' % a.alumno.id)}" py:content="a.alumno.shortrepr()" />
+ <a href="${tg.url('/curso/alumno/show/%d/%d' % (a.alumno.id, a.alumno.curso.id))}" py:content="a.alumno.shortrepr()" />
<br />
</span>
</td>