def resource_query(name):
 def make_responder(query_func):
  def responder(queries):
   return app.response_class(json_generator(query_func(queries), root='results', expand=is_expand()), mimetype='application/json')
  responder.__name__ = 'query_{0}'.format(name)
  return responder
 return make_responder

def resource_query ( name ) : def make_responder ( query_func ) : def responder ( queries ) : return app . response_class ( json_generator ( query_func ( queries ) , root = 'results' , expand = is_expand ( ) ) , mimetype = 'application/json' ) responder . __name__ = 'query_{0}' . format ( name ) return responder return make_responder
decorates a function to handle restful http queries for resources .