adhocracy_core.sheets.pool module

List, search and filter child resources.

class PoolSheet(meta: adhocracy_core.interfaces.SheetMetadata, context: <InterfaceClass adhocracy_core.interfaces.IResourceSheet>, registry: pyramid.registry.Registry, request: <InterfaceClass pyramid.interfaces.IRequest>=None, creating: adhocracy_core.interfaces.ResourceMetadata=None)[source]

Bases: adhocracy_core.sheets.AnnotationRessourceSheet

Pool resource sheet that allows filtering and aggregating elements.

get(params: dict={}, add_back_references=True, omit_readonly=False) → dict[source]

Return child references or arbitrary search for descendants.

Return type:dict
Parameters:params (dict) – Parameters to update the search query to find elements references (possible items are described in adhocracy_core.interfaces.SearchQuery). The default search query is set in the _references_query property. If empty only direct child resources are returned and filtered by the target_isheet of the elements field.
Returns:dictionary with key/values according to adhocracy_core.interfaces.SearchResult
serialize(params: dict=None) → dict[source]

Get sheet appstruct data and serialize.

Extends adhocracy_core.interfaces.IResourceSheet.serialize() with the following parameters:

serialization_form (str):
serialization for references resources: omit returns an empty list, url the resource urls, content all resource data. Defaults to path.
show_count (bool):
add ‘count` field, defaults to True.
show_frequency (bool):
add ‘aggregateby` field. defaults to False.
interface IPool[source]

Extends: adhocracy_core.interfaces.ISheet

Marker interface for the pool sheet.

interface PoolElementsReference[source]

Extends: adhocracy_core.interfaces.SheetToSheet

Pool sheet elements reference.

class PoolSchema(*arg, **kw)[source]

Bases: adhocracy_core.schema.MappingSchema

Pool sheet data structure.

elements: children of this resource (object hierarchy).

includeme(config)[source]

Register adapter.