intranet.apps.groups package¶
Submodules¶
intranet.apps.groups.forms module¶
-
class
intranet.apps.groups.forms.
GroupForm
(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None, renderer=None)[source]¶ Bases:
django.forms.models.ModelForm
-
class
Meta
[source]¶ Bases:
object
-
fields
= ['name', 'permissions']¶
-
model
¶ alias of
intranet.apps.groups.models.Group
-
-
declared_fields
= {}¶
-
class
intranet.apps.groups.models module¶
-
class
intranet.apps.groups.models.
Group
(*args, **kwargs)[source]¶ Bases:
django.contrib.auth.models.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
-
exception
DoesNotExist
¶ Bases:
django.contrib.auth.models.DoesNotExist
-
exception
MultipleObjectsReturned
¶ Bases:
django.contrib.auth.models.MultipleObjectsReturned
-
objects
= <intranet.apps.groups.models.GroupManager object>¶
-
property
properties
¶
-
class
intranet.apps.groups.models.
GroupManager
[source]¶ Bases:
django.contrib.auth.models.GroupManager
This GroupManager model is really just the default Django django.contrib.auth.models.GroupManager, just with an extra method.
-
class
intranet.apps.groups.models.
GroupProperties
(*args, **kwargs)[source]¶ Bases:
django.db.models.base.Model
The GroupProperties model contains a OneToOneField with the intranet.apps.groups.models.Group object (really just the default django.contrib.auth.models.Group), and contains properties and other app-specific options about a group.
- group
A OneToOneField with a Group object.
- student_visible
Whether the group should be visible to students in group selections.
-
exception
DoesNotExist
¶
-
exception
MultipleObjectsReturned
¶
-
group
¶ Accessor to the related object on the forward side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Restaurant.place
is aForwardOneToOneDescriptor
instance.
-
group_id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
id
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
objects
= <django.db.models.manager.Manager object>¶
-
student_visible
¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.