adhocracy_core.sheets.metadata module

Metadata Sheet.

interface IMetadata[source]

Extends: adhocracy_core.interfaces.ISheet

Market interface for the metadata sheet.

interface MetadataCreatorsReference[source]

Extends: adhocracy_core.interfaces.SheetToSheet

Metadata sheet creators reference.

interface MetadataModifiedByReference[source]

Extends: adhocracy_core.interfaces.SheetToSheet

Points to the last person who modified a resource.

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

Bases: adhocracy_core.schema.MappingSchema

Metadata sheet data structure.

creation_date: Creation date of this resource. defaults to now.

item_creation_date: Equals creation date for ISimple/IPool, equals the item creation date for adhocracy_core.interfaces.IItemVersion. This exists to ease the frontend end development. This may go away if we have a high level API to make adhocracy_core.interfaces.Item / IItemVersion one thing. Defaults to now.

creator: creator (user resource) of this resource.

modified_by: the last person (user resources) who modified a resource, initially the creator

modification_date: Modification date of this resource. defaults to now.

hidden: whether the resource is marked as hidden (only shown to those that have special permissions and ask for it)

view_blocked_by_metadata(resource: <InterfaceClass adhocracy_core.interfaces.IResource>, registry: pyramid.registry.Registry, block_reason: str) → dict[source]

Return a dict with an explanation why viewing this resource is not allowed.

If the resource provides metadata, the date of the last change and its author are added to the result.

is_older_than(resource: <InterfaceClass adhocracy_core.sheets.metadata.IMetadata>, days: int) → bool[source]

Check if the creation date of context is older than days.

includeme(config)[source]

Register sheets, add subscriber to update creation/modification date.