everest.resources.utils

Resource related utilities.

everest.resources.utils.as_member(entity, parent=None)[source]

Adapts an object to a location aware member resource.

Parameters:
  • entity (an object implementing everest.entities.interfaces.IEntity) – a domain object for which a resource adapter has been registered
  • parent (an object implementing everest.resources.interfaces.ICollectionResource) – optional parent collection resource to make the new member a child of
Returns:

an object implementing everest.resources.interfaces.IMemberResource

everest.resources.utils.get_collection_class(rc)[source]

Returns the registered collection resource class for the given marker interface or member resource class or instance.

Parameters:rc (class implementing or instance providing or subclass of a registered resource interface.) – registered resource
everest.resources.utils.get_member_class(rc)[source]

Returns the registered member class for the given resource.

Parameters:rc (class implementing or instance providing or subclass of a registered resource interface.) – registered resource
everest.resources.utils.get_resource_url(resource)[source]

Returns the URL for the given resource.

everest.resources.utils.get_root_collection(rc)[source]

Returns a clone of the collection from the repository registered for the given registered resource.

Parameters:rc (class implementing or instance providing or subclass of a registered resource interface.) – registered resource
everest.resources.utils.get_stage_collection(rc)[source]

Returns a clone of the collection in the stage repository matching the given registered resource.

Parameters:rc (class implementing or instance providing or subclass of a registered resource interface.) – registered resource
everest.resources.utils.is_resource_url(url_string)[source]

Checks if the given URL string is a resource URL.

Currently, this check only looks if the URL scheme is either “http” or “https”.

everest.resources.utils.provides_collection_resource(obj)[source]

Checks if the given type or instance provides the everest.resources.interfaces.ICollectionResource interface.

everest.resources.utils.provides_member_resource(obj)[source]

Checks if the given type or instance provides the everest.resources.interfaces.IMemberResource interface.

everest.resources.utils.provides_resource(obj)[source]

Checks if the given type or instance provides the everest.resources.interfaces.IResource interface.

Project Versions

Previous topic

everest.resources.system

Next topic

everest.views.base

This Page