class documentation

class Collection: (source)

Known subclasses: twisted.python.roots.Constrained

View In Hierarchy

I represent a static collection of entities.

I contain methods designed to represent collections that can be dynamically created.

Method __init__ Initialize me.
Method del​Entity Remove a static reference for 'name'.
Method get​Dynamic​Entity Subclass this to generate an entity on demand.
Method get​Entity Retrieve an entity from me.
Method get​Static​Entity Get an entity that was added to me using putEntity.
Method list​Dynamic​Entities A list of all name, entity that I can generate on demand.
Method list​Dynamic​Names Retrieve a list of the names of entities that I store references to.
Method list​Entities Retrieve a list of all name, entity pairs I contain.
Method list​Names Retrieve a list of all names for entities that I contain.
Method list​Static​Entities Retrieve a list of all name, entity pairs that I store references to.
Method list​Static​Names Retrieve a list of the names of entities that I store references to.
Method put​Entity Store a static reference on 'name' for 'entity'.
Method remove​Entity Remove an entity for 'name', based on the content of 'request'.
Method store​Entity Store an entity for 'name', based on the content of 'request'.
Instance Variable entities Undocumented
def __init__(self, entities=None): (source)
Initialize me.
def delEntity(self, name): (source)

Remove a static reference for 'name'.

Raises a KeyError if the operation fails.

def getDynamicEntity(self, name, request): (source)

Subclass this to generate an entity on demand.

This method should return 'None' if it fails.

def getEntity(self, name, request): (source)

Retrieve an entity from me.

I will first attempt to retrieve an entity statically; static entities will obscure dynamic ones. If that fails, I will retrieve the entity dynamically.

If I cannot retrieve an entity, I will return 'None'.

def getStaticEntity(self, name): (source)

Get an entity that was added to me using putEntity.

This method will return 'None' if it fails.

def listDynamicEntities(self, request): (source)

A list of all name, entity that I can generate on demand.

See getDynamicEntity.

def listDynamicNames(self): (source)

Retrieve a list of the names of entities that I store references to.

See getDynamicEntity.

def listEntities(self, request): (source)

Retrieve a list of all name, entity pairs I contain.

See getEntity.

def listNames(self, request): (source)

Retrieve a list of all names for entities that I contain.

See getEntity.

def listStaticEntities(self): (source)

Retrieve a list of all name, entity pairs that I store references to.

See getStaticEntity.

def listStaticNames(self): (source)

Retrieve a list of the names of entities that I store references to.

See getStaticEntity.

def putEntity(self, name, entity): (source)

Store a static reference on 'name' for 'entity'.

Raises a KeyError if the operation fails.

def removeEntity(self, name, request): (source)
Remove an entity for 'name', based on the content of 'request'.
def storeEntity(self, name, request): (source)
Store an entity for 'name', based on the content of 'request'.
entities = (source)

Undocumented