adhocracy_core.sheets package¶
Data structures/validation, set/get for an isolated set of resource data.
-
class
BaseResourceSheet(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:
objectSheet object to get/set resource data defined by a term:schema.
Variables: - meta (SheetMetadata) – The sheet configuration
- context (IResource) –
Resource to set/get data, find services, traverse object hierarchy.
If creating this should be the parent of the to be created resource.
- registry – Pyramid registry to get Adapters, sheets, metadata, settings, ...
- request (pyramid.interfaces.IRequest) –
The current request or None.
Use for permission checks, serialize/deserialize Resource-URLs, get user (
IResourceSheet.deserialze()andIResourceSheet.serialize()depend request). - creating (ResourceMetadata) –
The configuration of the to be created resource.
If not None the context attribute should be the parent of the new resource and set/get methods should not be used.
Used by deferred validators to allow different behavior when creating.
- schema (colander.MappingSchema) –
schema to define the data structure (without bindings).
Deferred schema validators and defaults values are not executed yet. To the the schema with bindings use:
IResourceSheet.get_schema_with_bindings().Deferred default values can rely on the following bindings:
context, registry, creatingDeferred validators can rely on the following bindings:
context, registry, request, creating
-
get(params: dict={}, add_back_references=True, omit_defaults=False) → dict[source]¶ Return appstruct data.
-
set(appstruct: dict, omit=(), send_event=True, send_reference_event=True, omit_readonly: bool=True, autoupdated=False) → bool[source]¶ Store appstruct.
-
serialize(params: dict=None, add_back_references: bool=True)[source]¶ Get sheet appstruct data and serialize.
-
class
AnnotationRessourceSheet(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.BaseResourceSheetResource Sheet that stores data in dictionary annotation.
-
class
AttributeResourceSheet(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.BaseResourceSheetResource Sheet that stores data as context attributes.
-
add_sheet_to_registry(metadata: adhocracy_core.interfaces.SheetMetadata, registry: pyramid.registry.Registry)[source]¶ Register sheet adapter and metadata to registry.
There registry should have an content attribute with
adhocracy_core.registry.ResourceRegistryto store the metadata.
Submodules¶
- adhocracy_core.sheets.asset module
- adhocracy_core.sheets.badge module
- adhocracy_core.sheets.comment module
- adhocracy_core.sheets.description module
- adhocracy_core.sheets.document module
- adhocracy_core.sheets.embed module
- adhocracy_core.sheets.geo module
- adhocracy_core.sheets.image module
- adhocracy_core.sheets.logbook module
- adhocracy_core.sheets.metadata module
- adhocracy_core.sheets.name module
- adhocracy_core.sheets.pool module
- adhocracy_core.sheets.principal module
- adhocracy_core.sheets.rate module
- adhocracy_core.sheets.relation module
- adhocracy_core.sheets.subresources module
- adhocracy_core.sheets.tags module
- adhocracy_core.sheets.title module
- adhocracy_core.sheets.versions module
- adhocracy_core.sheets.workflow module