Resources.
Bases: everest.resources.base.Resource
This is an abstract base class for all resource collections. A collection is a set of member resources which can be filtered, sorted, and sliced.
Gets a member (by name).
Parameters: | key (string or unicode) – the name of the member |
---|---|
Raises : | everest.exceptions.DuplicateException if more than one member is found for the given key value. |
Returns: | object implementing everest.resources.interfaces.IMemberResource |
Constructor:
Parameters: |
|
---|
Adds the given member to this collection.
Parameters: | member (object implementing everest.resources.interfaces.IMemberResource) – member to add. |
---|---|
Raises ValueError: | |
if a member with the same name exists |
Creates a new collection from the given aggregate.
Parameters: | aggregate (everest.entities.aggregates.Aggregate instance) – aggregate containing the entities exposed by this collection resource |
---|
Creates a new member resource from the given entity and adds it to this collection.
The default order of the collection’s members.
A description of the collection.
Returns a member for the given key or the given default value if no match was found in the collection.
Returns the aggregate underlying this collection.
Returns: | an object implementing everest.entities.interfaces.IAggregate. |
---|
The maximum number of member that can be shown on one page (superclass default: 1000).
Removes the given member from this collection.
Parameters: | member (object implementing everest.resources.interfaces.IMemberResource) – member to add. |
---|---|
Raises ValueError: | |
if the member can not be found in this collection |
The name for the root collection (used as URL path to the root collection inside the service).
Sets the relation parent for this collection.
The relation parent affects the expressions built for filter and order operations.
Parameters: | relationship – relation with another resource, encapsulated in a everest.relationship.Relationship instance. |
---|
The title of the collection.
Updates this collection from the given data element.
This iterates over the members of this collection and checks if a member with the same ID exists in the given update data. If yes, the existing member is updated with the update member; if no, the member is removed. All data elements in the update data that have no ID are added as new members. Data elements with an ID that can not be found in this collection trigger an error.
Parameters: | data_element (object implementing :class:everest.resources.interfaces.IExplicitDataElement) – data element (hierarchical) to create a resource from |
---|---|
Raises ValueError: | |
when a data element with an ID that is not present in this collection is encountered. |
Bases: everest.resources.attributes.ResourceAttributeControllerMixin, everest.resources.base.Resource
This is an abstract class for all member resources.
Constructor:
Parameters: |
|
---|
Class factory method creating a new resource from the given entity.
Deletes this member.
Deleting a member resource means removing it from its parent resource.
Bases: object
This is the abstract base class for all resources.
list of weak references to the object (if defined)
Adds a link to another resource.
Parameters: | link (everest.resources.base.Link) – a resource link |
---|
Creates a resource instance from the given data element (tree).
Parameters: | data_element (object implementing everest.resources.representers.interfaces.IExplicitDataElement) – data element (hierarchical) to create a resource from |
---|
Detailed description of this resource.
A set of links to other resources.
The relation identifier to show in links to this resource. Needs to be specified in derived classes.
Descriptive title for this resource.