Group

Qualified name: intranet.apps.groups.models.Group

class intranet.apps.groups.models.Group(*args, **kwargs)[source]

Bases: Group

This Group model is really just the default Django django.contrib.auth.models.Group, but with a “properties” property which returns or creates the GroupProperties field for that group. Because GroupProperties objects are only created here when they are first accessed, and not on creation or edit, you must always access them directly through the Group object, and not through GroupProperties.

This presents some complications. All model-level relationships for a group should use the Django contrib.auth.models.Group object, and not the custom one defined here. You will see this done, to avoid confusion, like:

from django.contrib.auth.models import Group as DjangoGroup

with DjangoGroup being referenced in the OneToOne or ManyToMany relationship.

e.x.:

Group.objects.get(id=9).properties.student_visible

Parameters:

Relationship fields:

Parameters:

permissions (ManyToManyField to Permission) – Permissions (related name: group)

Reverse relationships:

Parameters:

Methods

Attributes

objects

properties