adhocracy_core.resources.pool module

Basic type with children typically to create process structures.

interface IBasicPool[source]

Extends: adhocracy_core.interfaces.IPool

Basic Pool.

class Pool(data=None, family=None)[source]

Bases: adhocracy_core.resources.base.Base, substanced.folder.Folder

An Auto-Naming Folder.

Custom names are allowed and coexists with the autogenerated names.

The next_name method sequentially increments the last name: 0000001, then 0000002, and so on.

Counter that should increment if descendants are changed.

next_name(subobject, prefix='') → str[source]

Generate name to add subobject to the folder.

This method does:

  • increment the last generated name associated to the prefix.
  • zero-filling the left hand side of the result with 7 zeros.
  • add prefix to the left hand side if any

If the generated Name exists add timestamp to the right side.

add_next(subobject, prefix='')[source]

Add a subobject and name it automatically.

Use the name returned by this folder’s next_name method.

find_service(service_name, *sub_service_names)[source]

Return the service for the given context.

remove(name, send_events: bool=True, registry: pyramid.registry.Registry=None, **kwargs)[source]

Delete subresource name from database.

Raises:KeyError – if name is not a valid subresource name
includeme(config)[source]

Add resource type to registry.