collective.multiworkflow.querystring.query_index_modifiers

collective.multiworkflow.querystring.query_index_modifiers#

Redirect review_state collection queries onto the chain index.

class collective.multiworkflow.querystring.query_index_modifiers.ReviewStateModifier[source]#

Rewrite a parsed review_state query to target workflow_states.

collective.multiworkflow.querystring.query_index_modifiers.VALUE_KEYS = ('query', 'not')#

The keys of a parsed query whose contents are state values.

collective.multiworkflow.querystring.query_index_modifiers.qualify(state: str) str[source]#

Name the workflow a bare state id belongs to.

Values in the index read <workflow-id>|<state-id>, but a criterion written against review_state — a stored collection predating this add-on, or a query built in code — carries a bare published. Left alone, such a value matches nothing at all, which reads as "no content in that state" rather than as a query that could never have worked.

So a bare id is read as belonging to the site's default workflow, which is the same workflow the index always lists first.

Parameters:

state -- a state id, qualified or not.

Returns:

the value as the index holds it; unchanged when it was already qualified, or when the site declares no default chain to attribute it to.