Exemple #1
0
 def _render_response(self, value, system):
     """ Render a response """
     view = system['view']
     enc_class = getattr(view, '_json_encoder', None)
     if enc_class is None:
         enc_class = get_json_encoder()
     return json.dumps(value, cls=enc_class)
Exemple #2
0
 def _render_response(self, value, system):
     """ Render a response """
     view = system['view']
     enc_class = getattr(view, '_json_encoder', None)
     if enc_class is None:
         enc_class = get_json_encoder()
     return json.dumps(value, cls=enc_class)
Exemple #3
0
 def _get_common_kwargs(self, system):
     """ Get kwargs common for all methods. """
     enc_class = getattr(system['view'], '_json_encoder', None)
     if enc_class is None:
         enc_class = get_json_encoder()
     return {
         'request': system['request'],
         'encoder': enc_class,
     }
Exemple #4
0
 def _get_common_kwargs(self, system):
     """ Get kwargs common for all methods. """
     enc_class = getattr(system['view'], '_json_encoder', None)
     if enc_class is None:
         enc_class = get_json_encoder()
     return {
         'request': system['request'],
         'encoder': enc_class,
     }