signoffs.core.signing_order.signing_order#
Signoff sequence ordering automation, based on pattern matching Signoff instances to expected Types.
Module Contents#
Classes#
A descriptor used to “inject” a SigningOrder Strategy object into its owner’s instances. The strategy_class provides a strategy for sequencing the owner’s signoffs (signet_set). |
|
Protocol for defining the API required to define a strategy for ordering a sequence of signoffs |
|
Ordering Strategy: match a pattern of Signoff Types defining a “signing order” against a signets queryset. |
API#
- class signoffs.core.signing_order.signing_order.SigningOrder(*pattern, signet_set_accessor='signatories', strategy_class=None)[source]#
A descriptor used to “inject” a SigningOrder Strategy object into its owner’s instances. The strategy_class provides a strategy for sequencing the owner’s signoffs (signet_set).
Initialization
This descriptor injects a
SigningOrderStrategyProtocolobject to manage the signing order for the owner’ssignet_setpatternis a sequence ofSigningOrderPatternobjects (or Signoff Types, which are also legal Pattern tokens) defining the signing order, typically for an Approval, but any kind of owner object.patternis passed directly through to thestrategy_classconstructor, so could, in theory, be anything.signet_set_accessoris string with name of callable or attribute for aSignetmanager on that owner instance.strategy_classallows this descriptor to be re-used with other ordering strategies- default_strategy_class#
None
- class signoffs.core.signing_order.signing_order.SigningOrderStrategyProtocol[source]#
Bases:
typing.ProtocolProtocol for defining the API required to define a strategy for ordering a sequence of signoffs
- class signoffs.core.signing_order.signing_order.SigningOrderPatternMatcher(pattern: signoffs.core.signing_order.signoff_pattern.SigningOrderPattern, signets_queryset)[source]#
Ordering Strategy: match a pattern of Signoff Types defining a “signing order” against a signets queryset.
Implements SigningOrderStrategyProtocol match result object can answer questions like: - does the sequence of signoffs satisfy the pattern defined; and - what SignoffType(s) could be added to the sequence next?
Initialization
Match the signets queryset against the Singing Order pattern signet_set must be ordered chronologically (by timestamp), which is default ordering for Signet
- property match#
Return a pm.MatchResult object for matching pattern against queryset (lazy evaluation)