X-Git-Url: https://git.llucax.com/z.facultad/75.52/sercom.git/blobdiff_plain/c7acc0ade7f7a3c8e40efae831caf46fa6433351..c3014f5f1bb51734bf6095409c085ea011ad95b8:/sercom/subcontrollers/curso/grupo/__init__.py diff --git a/sercom/subcontrollers/curso/grupo/__init__.py b/sercom/subcontrollers/curso/grupo/__init__.py index 7d1e8d1..b76e9a4 100644 --- a/sercom/subcontrollers/curso/grupo/__init__.py +++ b/sercom/subcontrollers/curso/grupo/__init__.py @@ -7,14 +7,19 @@ 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 turbogears import paginate, url from docutils.core import publish_parts from sercom.subcontrollers import validate as val from sercom.model import Curso, AlumnoInscripto, Docente, DocenteInscripto, Grupo, Alumno, Miembro from sqlobject import * +from sqlobject.dberrors import * from sercom.widgets import * +import logging + +log = logging.getLogger('sercom.curso.grupo.admin') + #}}} #{{{ Configuración @@ -132,6 +137,154 @@ class GrupoForm(W.TableForm): form = GrupoForm() +def get_gruposA(cursoID): + return [(0, u'---')] + [(g.id, g.shortrepr()) for g in Grupo.select(Grupo.q.cursoID==cursoID)] + +def get_gruposB(cursoID): + return [(0, u'Nuevo Grupo')] + [(g.id, g.shortrepr()) for g in Grupo.select(Grupo.q.cursoID==cursoID)] + +ajaxadmin = u""" + function err (err) + { + alert("The metadata for MochiKit.Async could not be fetched :("); + } + + function doSubmit() + { + /* TODO : Validar datos y evitar el submit si no esta completo */ + + /* Selecciono todos los miembros si no, no llegan al controllere*/ + l = MochiKit.DOM.getElement('form_grupos_to'); + for (i=0; i