from aquarium.screen.Controller import Controller
class index(Controller):
def __call__(self):
ctx = self._ctx
self.executeAction()
ctx.iLib.forward("index_view")
def doCalculateAction(self):
ctx = self._ctx
try:
result = int(ctx.form["left"]) + int(ctx.form["right"])
except (ValueError, KeyError):
ctx.actionResults = "Ah, nuts!"
return
ctx.iLib.forward("index_view", result)
|