class Organization:

Reference implementation of an Organization. Organizations are used for defining the structure of a quality report. Every Organization class should be able to:

  • load the full organization tree from a data source using .load()
  • initialize each single organization in the tree using .__init__()
  • implement the methods .users(), .parents(), .children() and .fact_sheets().
Organization(name, head, members, parent)

Initialize an organization.

def load(cls, org_model):

Loads an organization tree from the data source specified, in this case the org_model configuration.

def users(self, force_refresh=False):

Returns the users in an organization, including the head of the organization.

def load_from_subscriptions(cls):
def parents(self):

Returns the parent organizations of an organization. This is usually a list with only one element, except in matrix organizations.

def children(self):

Returns the child organizations of an organization.

def fact_sheets(self, role):

Returns all fact sheets where any of the users in the organization has a subscription of the role specified by the role parameter.