web/views/basecontrollers.py
branchstable
changeset 2079 aff0950c54c4
parent 2045 bf0643d4ef36
child 2144 51c84d585456
child 2240 ff84892900ac
equal deleted inserted replaced
2078:362703bff3d4 2079:aff0950c54c4
   237 
   237 
   238         note: it's the responsability of js_* methods to set the correct
   238         note: it's the responsability of js_* methods to set the correct
   239         response content type
   239         response content type
   240         """
   240         """
   241         self.req.pageid = self.req.form.get('pageid')
   241         self.req.pageid = self.req.form.get('pageid')
   242         fname = self.req.form['fname']
   242         try:
   243         try:
   243             fname = self.req.form['fname']
   244             func = getattr(self, 'js_%s' % fname)
   244             func = getattr(self, 'js_%s' % fname)
       
   245         except KeyError:
       
   246             raise RemoteCallFailed('no method specified')
   245         except AttributeError:
   247         except AttributeError:
   246             raise RemoteCallFailed('no %s method' % fname)
   248             raise RemoteCallFailed('no %s method' % fname)
   247         # no <arg> attribute means the callback takes no argument
   249         # no <arg> attribute means the callback takes no argument
   248         args = self.req.form.get('arg', ())
   250         args = self.req.form.get('arg', ())
   249         if not isinstance(args, (list, tuple)):
   251         if not isinstance(args, (list, tuple)):