physics_workload.app.models.academic_group

Attributes

Classes

AcademicGroup

Academic group, e.g. Astro, Theory, QLM...

Module Contents

physics_workload.app.models.academic_group.logger: logging.Logger
class physics_workload.app.models.academic_group.AcademicGroup

Bases: app.models.common.ModelCommon

Academic group, e.g. Astro, Theory, QLM…

Named AcademicGroup to avoid collision with base Django Group, which is more about user permissions.

icon = 'users'
url_root = 'group'
code
short_name
name
load_balance_final
load_balance_historic
class Meta
ordering = ('name',)
verbose_name = 'Group'
verbose_name_plural = 'Groups'
__str__()
get_short_name() str
Returns:

The short name. Needed for parity with the Unit model, for Task ownership.

get_instance_header(text: str | None = None) str

Uses the full name for the header of one of these.

Parameters:

text – Text of the header, unused.

Returns:

A rendered header string with the name of the instance.

has_access(user: users.models.CustomUser) bool

Only users assigned who are members of an academic group can view it.

Parameters:

user – The user.

Returns:

True if the user is allowed to view the group.

update_load() bool

Updates the load balance for the group

Returns:

True if the load has changed.

get_load_balance() int

Gets the load balance of all the group members.

Returns:

The load balance.