Package expedient :: Package clearinghouse :: Package roles :: Module models :: Class ProjectRoleManager
[hide private]
[frames] | no frames]

Class ProjectRoleManager

source code


Manager for ProjectRole instances.

Instance Methods [hide private]
QuerySet of User objects.
get_users_with_role(self, role_name, project)
Get a User query set for users that have role role_name in project project
source code
QuerySet of ProjectRoles.
filter_for_can_delegate(self, permittee, project)
filter for all roles the permittee can fully delegate in a project
source code
QuerySet for ProjectRole.
filter_for_permission(self, perm_name, target)
Filter roles that have the permission perm_name for target.
source code

Inherited from django.db.models.manager.Manager: __init__, aggregate, all, annotate, complex_filter, contribute_to_class, count, create, dates, db_manager, defer, distinct, exclude, exists, extra, filter, get, get_empty_query_set, get_or_create, get_query_set, in_bulk, iterator, latest, none, only, order_by, raw, reverse, select_related, update, using, values, values_list

Inherited from django.db.models.manager.Manager (private): _copy_to_model, _insert, _set_creation_counter, _update

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]

Inherited from django.db.models.manager.Manager: creation_counter

Properties [hide private]

Inherited from django.db.models.manager.Manager: db

Inherited from object: __class__

Method Details [hide private]

get_users_with_role(self, role_name, project)

source code 

Get a User query set for users that have role role_name in project project

Parameters:
  • role_name (str.) - Name of the project role.
  • project (Project.) - project instance.
Returns: QuerySet of User objects.
all users with that role in the project

filter_for_can_delegate(self, permittee, project)

source code 

filter for all roles the permittee can fully delegate in a project

Parameters:
  • permittee (Permittee or django.db.models.Model) - object to check for delegatable roles.
  • project (Project) - the project to filter roles for
Returns: QuerySet of ProjectRoles.
all project roles the permittee can delegate.

filter_for_permission(self, perm_name, target)

source code 

Filter roles that have the permission perm_name for target.

Parameters:
  • perm_name (str.) - The name of the permission to filter the roles for.
  • target (instance of Model. Note this cannot be a class.) - The object that is the target of the permission.
Returns: QuerySet for ProjectRole.
Only project roles that have the permission for the target.