# vim: set et sw=4 sts=4 encoding=utf-8 :
+import cherrypy
from turbogears import controllers, expose, redirect
from turbogears import validate, validators, flash, error_handler
-from sercom.model import Docente
from turbogears.widgets import *
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 Docente
cls = Docente
name = 'docente'
r = validate_get(id)
try:
r.activo = bool(int(activo))
- except ValueError, e:
- raise redirect('../list', tg_flash=_(u'Acción inválida.'))
- raise redirect('../list')
+ except ValueError:
+ raise cherrypy.NotFound
+ raise redirect('../../list')
@expose(template='kid:%s.templates.new' % __name__)
def new(self, **kw):
def show(self,id, **kw):
"""Show record in model"""
r = validate_get(id)
- r.obs = publish_parts(r.observaciones, writer_name='html')['html_body']
+ if r.observaciones is None:
+ r.obs = ''
+ else:
+ r.obs = publish_parts(r.observaciones, writer_name='html')['html_body']
return dict(name=name, namepl=namepl, record=r)
@expose()