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
Relationship fields:
- Parameters:
permissions (
ManyToManyField
toPermission
) – Permissions (related name:group
)
Reverse relationships:
- Parameters:
announcement (Reverse
ManyToManyField
fromAnnouncement
) – All announcements of this group (related name ofgroups
)app (Reverse
ManyToManyField
fromApp
) – All apps of this group (related name ofgroups_visible
)restricted_activity_set (Reverse
ManyToManyField
fromEighthActivity
) – All restricted activity set of this group (related name ofgroups_allowed
)allowed_enrichments_set (Reverse
ManyToManyField
fromEnrichmentActivity
) – All allowed enrichments set of this group (related name ofgroups_allowed
)blacklisted_enrichments_set (Reverse
ManyToManyField
fromEnrichmentActivity
) – All blacklisted enrichments set of this group (related name ofgroups_blacklisted
)event (Reverse
ManyToManyField
fromEvent
) – All events of this group (related name ofgroups
)groupproperties (Reverse
OneToOneField
fromGroupProperties
) – The group properties of this group (related name ofgroup
)user (Reverse
ManyToManyField
fromUser
) – All user set of this group (related name ofgroups
)host (Reverse
ManyToManyField
fromHost
) – All hosts of this group (related name ofgroups_visible
)poll (Reverse
ManyToManyField
fromPoll
) – All polls of this group (related name ofgroups
)
Methods
Attributes
objects
properties