adhocracy_core.events package¶
Hooks to modify runtime behavior (use ‘subscriber.py’ in you package).
In addition we have the normal substanced events: https://substanced.readthedocs.org/en/latest/api.html#module-substanced.event
-
class
ResourceCreatedAndAdded(object, parent, registry, creator, autoupdated)[source]¶ Bases:
objectAn event type sent when a new IResource is created and added.
Parameters: - object(adhocracy_core.interfaces.IResource) –
- parent(adhocracy_core.interfaces.IResource) –
- registry(pyramid.registry.Registry) –
- creator(adhocracy_core.resource.principal.IUser) –
Param: autoupdated(bool): The creation was caused by the application, for example service resources or automatic updates of referencing resources.
Initialize self.
-
class
ResourceWillBeDeleted(object, parent, registry)[source]¶ Bases:
objectAn event type sent when a IResource will be deleted.
Parameters: - object(adhocracy_core.interfaces.IResource) –
- parent(adhocracy_core.interfaces.IResource) –
- registry(pyramid.registry.Registry) –
Initialize self.
-
class
ResourceSheetModified(object, isheet, registry, old_appstruct, new_appstruct, request: pyramid.request.Request, autoupdated: bool)[source]¶ Bases:
objectAn event type sent when a resource sheet is modified.
Parameters: Param: autoupdated(bool): The modification was caused by a modified referenced resource.
Initialize self.
-
class
ItemVersionNewVersionAdded(object, new_version, registry, creator, autoupdated)[source]¶ Bases:
objectAn event sent when a new IItemVersion is being added.
Parameters: - object(adhocracy_core.interfaces.IItem) –
- new_version(adhocracy_core.interfaces.IItemVersion) –
- registry(pyramid.registry.Registry) –
- creator(adhocracy_core.resource.principal.IUser' –
Param: autoupdated(bool): The modification was caused by a modified referenced resource.
Initialize self.
-
class
SheetReferenceNewVersion(object, isheet, isheet_field, old_version, new_version, registry, creator, root_versions=[], is_batchmode=False)[source]¶ Bases:
objectAn event type sent when a referenced ItemVersion has a new follower.
Parameters: - object(adhocracy_core.interfaces.IResource) –
- isheet(adhocracy_core.interfaces.IISheet) –
- isheet_field(str) – field name with updated reference
- old_version(adhocracy_core.interfaces.IItemVersion) – old referenced resource
- new_version(adhocracy_core.interfaces.IItemVersion) – new referenced resource
- registry(pyramid.registry.Registry) –
- root_versions(list) – IItemVersions not in the subtree of these root resources should ignore this event. Optional.
- creator(adhocracy_core.resource.principal.IUser' –
- is_batchmode(bool) – Flag to do sheet autoupdates in batch request mode. Defaults to False.
Initialize self.
-
class
SheetBackReferenceRemoved(object, isheet, reference, registry)[source]¶ Bases:
objectAn event type sent when a back reference is removed.
Initialize self.
-
object= None¶
-
isheet= None¶
-
reference= None¶ adhocracy_core.graph.Referencethat was targeting object.
-
registry= None¶ pyramid.content.Registry
-
-
class
SheetBackReferenceAdded(object, isheet, reference, registry)[source]¶ Bases:
objectAn event type sent when a back reference is added.
Initialize self.
-
object= None¶
-
isheet= None¶
-
reference= None¶ adhocracy_core.graph.Referencethat is targeting object.
-
registry= None¶ pyramid.content.Registry
-
-
class
LocalRolesModified(object, new_local_roles: dict, old_local_roles: dict, registry: pyramid.registry.Registry)[source]¶ Bases:
objectAn event type send when an resource`s local role is modified.
Initialize self.