def get_resource_uri_template(resource, include_child):
 if (resource.name == 'root'):
  path = '/api/'
 else:
  if resource._parent_resource:
   path = get_resource_uri_template(resource._parent_resource, True)
  path += ('%s/' % resource.uri_name)
  if ((not resource.singleton) and include_child and resource.model):
   path += ('{%s}/' % resource.uri_object_key)
 return path

def get_resource_uri_template ( resource , include_child ) : if ( resource . name == 'root' ) : path = '/api/' else : if resource . _parent_resource : path = get_resource_uri_template ( resource . _parent_resource , True ) path += ( '%s/' % resource . uri_name ) if ( ( not resource . singleton ) and include_child and resource . model ) : path += ( '{%s}/' % resource . uri_object_key ) return path
returns the uri template for a resource .