+ raise redirect(url('/'))
+
+ docente = DocenteController()
+
+ alumno = AlumnoController()
+
+ enunciado = EnunciadoController()
+
+ ejercicio = EjercicioController()
+
+ tarea_fuente = TareaFuenteController()
+
+ tarea_prueba = TareaPruebaController()
+
+ curso = CursoController()
+
+ docente_inscripto = DocenteInscriptoController()
+
+ correccion = CorreccionController()
+
+ admin = identity.SecureObject(CatWalk(model), identity.has_permission('admin'))
+
+ mis_entregas = MisEntregasController()
+
+ mis_correcciones = MisCorreccionesController()
+
+#{{{ Agrega summarize a namespace tg de KID
+def summarize(text, size, concat=True, continuation='...'):
+ """Summarize a string if it's length is greater than a specified size. This
+ is useful for table listings where you don't want the table to grow because
+ of a large field.
+
+ >>> from sercome.controllers
+ >>> text = '''Why is it that nobody remembers the name of Johann
+ ... Gambolputty de von Ausfern-schplenden-schlitter-crasscrenbon-fried-
+ ... digger-dingle-dangle-dongle-dungle-burstein-von-knacker-thrasher-apple-
+ ... banger-horowitz-ticolensic-grander-knotty-spelltinkle-grandlich-
+ ... grumblemeyer-spelterwasser-kurstlich-himbleeisen-bahnwagen-gutenabend-
+ ... bitte-ein-nurnburger-bratwustle-gernspurten-mitz-weimache-luber-
+ ... hundsfut-gumberaber-shonedanker-kalbsfleisch-mittler-aucher von
+ ... Hautkopft of Ulm?'''
+ >>> summarize(text, 30)
+ 'Why is it that nobody remem...'
+ >>> summarize(text, 68, False, ' [...]')
+ 'Why is it that nobody remembers the name of Johann\nGambolputty [...]'
+ >>> summarize(text, 68, continuation=' >>')
+ 'Why is it that nobody remembers the name of Johann Gambolputty de >>'
+ """
+ if text is not None:
+ if concat:
+ text = text.replace('\n', ' ')
+ if len(text) > size:
+ text = text[:size-len(continuation)] + continuation
+ return text
+
+def strbool(bool):
+ if bool:
+ return _(u'Sí')
+ return _(u'No')
+
+def add_custom_stdvars(vars):
+ return vars.update(dict(summarize=summarize, strbool=strbool))
+
+view.variable_providers.append(add_custom_stdvars)
+#}}}