def create_fake_resource_path(request, resource, child_keys, include_child):
 if (resource._parent_resource and (resource._parent_resource.name != 'root')):
  path = create_fake_resource_path(request, resource._parent_resource, child_keys, True)
 else:
  path = '/api/'
 if (resource.name != 'root'):
  path += ('%s/' % resource.uri_name)
  if ((not resource.singleton) and include_child and resource.model and resource.uri_object_key):
   q = resource.get_queryset(request, **child_keys)
   if (q.count() == 0):
    logging.critical('Resource "%s" requires objects in the database', resource.__class__)
    assert (q.count() > 0)
   obj = q[0]
   value = getattr(obj, resource.model_object_key)
   child_keys[resource.uri_object_key] = value
   path += ('%s/' % value)
 return path

def create_fake_resource_path ( request , resource , child_keys , include_child ) : if ( resource . _parent_resource and ( resource . _parent_resource . name != 'root' ) ) : path = create_fake_resource_path ( request , resource . _parent_resource , child_keys , True ) else : path = '/api/' if ( resource . name != 'root' ) : path += ( '%s/' % resource . uri_name ) if ( ( not resource . singleton ) and include_child and resource . model and resource . uri_object_key ) : q = resource . get_queryset ( request , ** child_keys ) if ( q . count ( ) == 0 ) : logging . critical ( 'Resource "%s" requires objects in the database' , resource . __class__ ) assert ( q . count ( ) > 0 ) obj = q [ 0 ] value = getattr ( obj , resource . model_object_key ) child_keys [ resource . uri_object_key ] = value path += ( '%s/' % value ) return path
creates a fake path to a resource .