def get_links(link_service): params = dict(request.params) for param in ('page', 'size'): if param in params: params[param] = int(params[param]) links_page = link_service.find(**params) links_page['objects'] = [serialize_link(i) for i in links_page['objects']] return links_page
def add_link(link_service): return serialize_link(link_service.create(deserialize_link( request.json), ))
def get_link(link_service, key): return serialize_link(link_service.get(key=key), )
def add_link(link_service): return serialize_link(link_service.create( deserialize_link(request.json), ))
def get_link(link_service, key): return serialize_link( link_service.get(key=key), )