From fe963d3537ee5d06fa63207bae8bfe229e3fb109 Mon Sep 17 00:00:00 2001 From: Ricardo Markiewicz Date: Wed, 14 Mar 2007 03:57:27 +0000 Subject: [PATCH] elimino tarea que no va para empezar ahora con el modelo Muzzarella --- sercom/subcontrollers/enunciado/__init__.py | 3 - .../enunciado/tarea/__init__.py | 131 ------------------ .../enunciado/tarea/templates/__init__.py | 0 .../enunciado/tarea/templates/list.kid | 28 ---- 4 files changed, 162 deletions(-) delete mode 100644 sercom/subcontrollers/enunciado/tarea/__init__.py delete mode 100644 sercom/subcontrollers/enunciado/tarea/templates/__init__.py delete mode 100644 sercom/subcontrollers/enunciado/tarea/templates/list.kid diff --git a/sercom/subcontrollers/enunciado/__init__.py b/sercom/subcontrollers/enunciado/__init__.py index 2195e2a..76906c6 100644 --- a/sercom/subcontrollers/enunciado/__init__.py +++ b/sercom/subcontrollers/enunciado/__init__.py @@ -11,7 +11,6 @@ from docutils.core import publish_parts from sercom.subcontrollers import validate as val from sercom.model import Enunciado, Docente, Curso from cherrypy import request, response -from tarea import TareaController #}}} @@ -83,8 +82,6 @@ class EnunciadoController(controllers.Controller, identity.SecureResource): """Basic model admin interface""" require = identity.has_permission('entregar') - tarea = TareaController() - @expose() def default(self, tg_errors=None): """handle non exist urls""" diff --git a/sercom/subcontrollers/enunciado/tarea/__init__.py b/sercom/subcontrollers/enunciado/tarea/__init__.py deleted file mode 100644 index 3fcf22f..0000000 --- a/sercom/subcontrollers/enunciado/tarea/__init__.py +++ /dev/null @@ -1,131 +0,0 @@ -# vim: set et sw=4 sts=4 encoding=utf-8 foldmethod=marker : - -#{{{ Imports -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 Tarea, Enunciado -#}}} - -#{{{ Configuración -cls = Tarea -name = 'tarea' -namepl = 'tareas' - -#}}} - -#{{{ Validación -def validate_get(id): - return val.validate_get(cls, name, id) - -def validate_set(id, data): - return val.validate_set(cls, name, id, data) - -def validate_new(data): - return val.validate_new(cls, name, data) - -def validate_del(id): - return val.validate_del(cls, name, id) -#}}} - -#{{{ Formulario -def get_options(): - return [(0, _(u'<>'))] + [(fk.id, fk.shortrepr()) - for fk in fkcls.select()] - -class CasoDePruebaForm(W.TableForm): - class Fields(W.WidgetsList): - nombre = W.TextField(label=_(u'Nombre'), - help_text=_(u'Requerido y único.'), - validator=V.UnicodeString(min=5, max=60, strip=True)) - descripcion = W.TextField(label=_(u'Descripción'), - validator=V.UnicodeString(not_empty=False, max=255, - strip=True)) - comando = W.TextField(label=_(u'Comando'), - validator=V.UnicodeString(not_empty=False, strip=True)) - retorno = W.TextField(label=_(u'Código de retorno'), - validator=V.Int(not_empty=False, strip=True)) - max_tiempo_cpu = W.TextField(label=_(u'Máximo tiempo de CPU'), - validator=V.Number(not_empty=False, strip=True)) - fields = Fields() - javascript = [W.JSSource("MochiKit.DOM.focusOnLoad('form_nombre');")] - -form = CasoDePruebaForm() -#}}} - -#{{{ Controlador - -class TareaController(controllers.Controller, identity.SecureResource): - """Basic model admin interface""" - require = identity.has_permission('admin') - - @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__) - @validate(validators=dict(enunciado=V.Int)) - def list(self, enunciado): - """List records in model""" - if enunciado is None: - raise redirect("../list") - r = Enunciado.get(enunciado) - return dict(enunciado=r) - - @expose(template='kid:%s.templates.new' % __name__) - def new(self, **kw): - """Create new records in model""" - return dict(name=name, namepl=namepl, form=form, values=kw) - - @validate(form=form) - @error_handler(new) - @expose() - def create(self, **kw): - """Save or create record to model""" - validate_new(kw) - flash(_(u'Se creó un nuevo %s.') % name) - raise redirect('list') - - @expose(template='kid:%s.templates.edit' % __name__) - def edit(self, id, **kw): - """Edit record in model""" - r = validate_get(id) - return dict(name=name, namepl=namepl, record=r, form=form) - - @validate(form=form) - @error_handler(edit) - @expose() - def update(self, id, **kw): - """Save or create record to model""" - r = validate_set(id, kw) - flash(_(u'El %s fue actualizado.') % name) - raise redirect('../list') - - @expose(template='kid:%s.templates.show' % __name__) - def show(self, id, **kw): - """Show record in model""" - r = validate_get(id) - if r.descripcion is None: - r.desc = '' - else: - r.desc = publish_parts(r.descripcion, writer_name='html')['html_body'] - return dict(name=name, namepl=namepl, record=r) - - @expose() - def delete(self, id): - """Destroy record in model""" - validate_del(id) - flash(_(u'El %s fue eliminado permanentemente.') % name) - raise redirect('../list') -#}}} - diff --git a/sercom/subcontrollers/enunciado/tarea/templates/__init__.py b/sercom/subcontrollers/enunciado/tarea/templates/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/sercom/subcontrollers/enunciado/tarea/templates/list.kid b/sercom/subcontrollers/enunciado/tarea/templates/list.kid deleted file mode 100644 index 4f8e37e..0000000 --- a/sercom/subcontrollers/enunciado/tarea/templates/list.kid +++ /dev/null @@ -1,28 +0,0 @@ - - - - -list - - - -

Tareas de "Objetos"

- - - - - - - - -
Tarea
tarea
- -
-Agregar -Volver - - - - - -- 2.43.0