wagtailapproval.models

class ApprovalPipeline(*args, **kwargs)[source]

Bases: wagtail.wagtailcore.models.Page

This page type is a very simple page that is only used to hold steps

class ApprovalStep(*args, **kwargs)[source]

Bases: wagtail.wagtailcore.models.Page

Holds posts and facilitates the automatic moving to other steps in the same pipeline on approval and rejection.

approve(obj)[source]

Run approval on an object

automatic_approval(obj)[source]

Possibly runs processing on an object for automatic approval or rejection

base_form_class

alias of StepForm

clean()[source]

Makes sure parents are the same

fix_permissions()[source]

Set proper restrictions for the owned collection and all owned pages. Does not perform a save, so it can be safely used in a post_save signal.

get_items(user)[source]

Gets an iterator of approval items, for rendering in templates. In practice, this returns a generator. If you need a stable view, use this to construct a list or tuple.

reject(obj)[source]

Run rejection on an object

release_ownership(obj)[source]

Release ownership of an object. This is idempotent.

set_collection_group_privacy(private)[source]

Sets/unsets the collection group privacy

set_page_group_privacy(page, private)[source]

Sets/unsets the page group privacy

take_ownership(obj)[source]

Take ownership of an object. Should run all relevant processing on changing visibility and other such things. This is idempotent.

transfer_ownership(obj, step)[source]

Give ownership to another step

class ApprovalTicket(*args, **kwargs)[source]

Bases: django.db.models.base.Model

A special junction table to reference an arbitrary item by uuid.

This is used to create an arbitrary approval/rejection URL, as it would be very difficult to do otherwise (as an approval step can own arbitrary pages and collection members with conflicting PKs otherwise). UUID is done for a minor security gain (prevent people from being able to try to act on arbitrary PKs, though that will be prevented through user privileges anyway, and the UUID should only be used for approvals and rejections, not GETs), as well as making the URL more opaque.