congress.db.db_policy_rules module

class congress.db.db_policy_rules.Policy(id_, name, abbreviation, description, owner, kind, deleted=False)

Bases: sqlalchemy.ext.declarative.api.Base, congress.db.model_base.HasId, congress.db.model_base.HasAudit

abbreviation
created_at
deleted
deleted_at
description
id
kind
name
owner
to_dict()

From a given database policy, return a policy dict.

updated_at
class congress.db.db_policy_rules.PolicyDeleted(policy_obj)

Bases: sqlalchemy.ext.declarative.api.Base, congress.db.model_base.HasId, congress.db.model_base.HasAudit

abbreviation
created_at
deleted
deleted_at
description
id
kind
name
owner
updated_at
class congress.db.db_policy_rules.PolicyRule(id, policy_name, rule, comment, deleted=False, rule_name='')

Bases: sqlalchemy.ext.declarative.api.Base, congress.db.model_base.HasId, congress.db.model_base.HasAudit

comment
created_at
deleted
deleted_at
id
name
policy_name
rule
to_dict()
updated_at
congress.db.db_policy_rules.add_policy(id_, name, abbreviation, description, owner, kind, deleted=False, session=None)
congress.db.db_policy_rules.add_policy_rule(id, policy_name, rule, comment, deleted=False, rule_name='', session=None)
congress.db.db_policy_rules.delete_policy(id_, session=None)
congress.db.db_policy_rules.delete_policy_rule(id, session=None)

Specify either the ID or the NAME, and that policy is deleted.

congress.db.db_policy_rules.get_policies(session=None, deleted=False)
congress.db.db_policy_rules.get_policy(name_or_id, session=None, deleted=False)
congress.db.db_policy_rules.get_policy_by_id(id_, session=None, deleted=False)
congress.db.db_policy_rules.get_policy_by_name(name, session=None, deleted=False)
congress.db.db_policy_rules.get_policy_rule(id, policy_name, session=None, deleted=False)
congress.db.db_policy_rules.get_policy_rules(policy_name=None, session=None, deleted=False)
congress.db.db_policy_rules.is_soft_deleted(uuid, deleted)
congress.db.db_policy_rules.policy_name(name_or_id, session=None)