X-Git-Url: https://git.llucax.com/z.facultad/75.52/sercom.git/blobdiff_plain/7bee4072574324ca7b3e6d8dc6deec589b13126f..d866624024289a9e2b6c9c1edd3297b511a346b3:/sercom/subcontrollers/docente/__init__.py diff --git a/sercom/subcontrollers/docente/__init__.py b/sercom/subcontrollers/docente/__init__.py index e01023d..e407081 100644 --- a/sercom/subcontrollers/docente/__init__.py +++ b/sercom/subcontrollers/docente/__init__.py @@ -38,11 +38,6 @@ form = TableForm(fields=[ validator=validators.Bool(if_empty=1)), ]) -def minimize(text, size=15): - if text is not None and len(text) > size: - text = text[:size] + '...' - return text - class DocenteController(controllers.Controller, identity.SecureResource): """Basic model admin interface""" require = identity.has_permission('admin') @@ -65,6 +60,13 @@ class DocenteController(controllers.Controller, identity.SecureResource): return dict(records=r, name=name, namepl=namepl, tg_flash=f) + @expose() + def activate(self, id, activo): + """Save or create record to model""" + cls.get(int(id)).activo = int(activo) + + raise redirect('../list') + @expose(template='kid:sercom.subcontrollers.%s.templates.new' % name) def new(self, **kw): """Create new records in model"""