Group¶
Qualified name: intranet.apps.groups.models.Group
- class intranet.apps.groups.models.Group(*args, **kwargs)[source]¶
Bases:
GroupThis 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
Relationship fields:
- Parameters:
permissions (
ManyToManyFieldtoPermission) – Permissions (related name:group)
Reverse relationships:
- Parameters:
announcement (Reverse
ManyToManyFieldfromAnnouncement) – All announcements of this group (related name ofgroups)app (Reverse
ManyToManyFieldfromApp) – All apps of this group (related name ofgroups_visible)restricted_activity_set (Reverse
ManyToManyFieldfromEighthActivity) – All restricted activity set of this group (related name ofgroups_allowed)allowed_enrichments_set (Reverse
ManyToManyFieldfromEnrichmentActivity) – All allowed enrichments set of this group (related name ofgroups_allowed)blacklisted_enrichments_set (Reverse
ManyToManyFieldfromEnrichmentActivity) – All blacklisted enrichments set of this group (related name ofgroups_blacklisted)event (Reverse
ManyToManyFieldfromEvent) – All events of this group (related name ofgroups)groupproperties (Reverse
OneToOneFieldfromGroupProperties) – The group properties of this group (related name ofgroup)user (Reverse
ManyToManyFieldfromUser) – All user set of this group (related name ofgroups)host (Reverse
ManyToManyFieldfromHost) – All hosts of this group (related name ofgroups_visible)poll (Reverse
ManyToManyFieldfromPoll) – All polls of this group (related name ofgroups)
Methods
Attributes
objectsproperties