activemembers package¶
Submodules¶
activemembers.admin module¶
Registers admin interfaces for the activemembers module.
-
class
activemembers.admin.ActiveMembershipsFilter(request, params, model, model_admin)[source]¶ Bases:
django.contrib.admin.filters.SimpleListFilterFilter the memberships by whether they are active or not.
-
lookups(request, model_admin)[source]¶ Must be overridden to return a list of tuples (value, verbose value)
-
parameter_name= 'active'¶
-
title= 'active memberships'¶
-
-
class
activemembers.admin.BoardAdmin(model, admin_site)[source]¶ Bases:
django.contrib.admin.options.ModelAdminManage the board.
-
exclude= ('is_board',)¶
-
fields= ('name', 'description', 'photo', 'permissions', 'contact_mailinglist', 'contact_email', 'since', 'until', 'display_members')¶
-
filter_horizontal= ('permissions',)¶
-
form¶ alias of
activemembers.forms.MemberGroupForm
-
inlines= (<class 'activemembers.admin.MemberGroupMembershipInline'>,)¶
-
property
media¶
-
-
class
activemembers.admin.CommitteeAdmin(model, admin_site)[source]¶ Bases:
activemembers.admin.MemberGroupAdminManage the committees.
-
property
media¶
-
property
-
class
activemembers.admin.LectureYearFilter(request, params, model, model_admin)[source]¶ Bases:
django.contrib.admin.filters.SimpleListFilterFilter the memberships on those started or ended in a lecture year.
-
lookups(request, model_admin)[source]¶ Must be overridden to return a list of tuples (value, verbose value)
-
parameter_name= 'lecture_year'¶
-
title= 'lecture year'¶
-
-
class
activemembers.admin.MemberGroupAdmin(model, admin_site)[source]¶ Bases:
django.contrib.admin.options.ModelAdminManage the member groups.
-
fields= ('name', 'description', 'photo', 'permissions', 'since', 'until', 'contact_mailinglist', 'contact_email', 'active', 'display_members')¶
-
filter_horizontal= ('permissions',)¶
-
form¶ alias of
activemembers.forms.MemberGroupForm
-
inlines= (<class 'activemembers.admin.MemberGroupMembershipInline'>,)¶
-
list_display= ('name', 'since', 'until', 'active', 'email')¶
-
list_filter= ('until', 'active')¶
-
property
media¶
-
search_fields= ('name', 'description')¶
-
-
class
activemembers.admin.MemberGroupMembershipAdmin(model, admin_site)[source]¶ Bases:
django.contrib.admin.options.ModelAdminManage the group memberships.
-
actions= ('export',)¶
-
date_hierarchy= 'since'¶
-
form¶
-
list_display= ('member', 'group', 'since', 'until', 'chair', 'role')¶
-
list_filter= ('group', <class 'activemembers.admin.TypeFilter'>, <class 'activemembers.admin.LectureYearFilter'>, <class 'activemembers.admin.ActiveMembershipsFilter'>)¶
-
property
media¶
-
search_fields= ('member__first_name', 'member__last_name', 'member__email')¶
-
-
class
activemembers.admin.MemberGroupMembershipInline(parent_model, admin_site)[source]¶ Bases:
django.contrib.admin.options.StackedInlineInline for group memberships.
-
autocomplete_fields= ('member',)¶
-
can_delete= False¶
-
extra= 0¶
-
formset¶ alias of
activemembers.admin.MemberGroupMembershipInlineFormSet
-
property
media¶
-
model¶
-
ordering= ('since',)¶
-
-
class
activemembers.admin.MemberGroupMembershipInlineFormSet(*args, **kwargs)[source]¶ Bases:
django.forms.models.BaseInlineFormSetSolely here for performance reasons.
Needed because the __str__() of MemberGroupMembership (which is displayed above each inline form) uses the username, name of the member and name of the group.
-
class
activemembers.admin.MentorshipAdmin(model, admin_site)[source]¶ Bases:
django.contrib.admin.options.ModelAdminManage the mentorships.
-
autocomplete_fields= ('member',)¶
-
list_filter= ('year',)¶
-
property
media¶
-
search_fields= ('member__first_name', 'member__last_name')¶
-
-
class
activemembers.admin.SocietyAdmin(model, admin_site)[source]¶ Bases:
activemembers.admin.MemberGroupAdminManage the societies.
-
property
media¶
-
property
-
class
activemembers.admin.TypeFilter(request, params, model, model_admin)[source]¶ Bases:
django.contrib.admin.filters.SimpleListFilterFilter memberships on board-only.
-
lookups(request, model_admin)[source]¶ Must be overridden to return a list of tuples (value, verbose value)
-
parameter_name= 'group_type'¶
-
title= 'group memberships'¶
-
activemembers.apps module¶
Configuration for the activemembers package.
activemembers.backends module¶
Authentication backend to check permissions.
activemembers.emails module¶
activemembers.forms module¶
The forms defined by the activemembers module.
-
class
activemembers.forms.MemberGroupForm(*args, **kwargs)[source]¶ Bases:
django.forms.models.ModelFormSolely here for performance reasons.
Needed because the __str__() of Permission (which is displayed in the permissions selection box) also prints the corresponding app and content_type for each permission.
-
base_fields= {}¶
-
declared_fields= {}¶
-
property
media¶ Return all media required to render the widgets on this form.
-
-
class
activemembers.forms.MemberGroupMembershipForm(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.ModelFormCustom form for group memberships that orders the members.
-
base_fields= {'chair': <django.forms.fields.BooleanField object>, 'group': <django.forms.models.ModelChoiceField object>, 'member': <django.forms.models.ModelChoiceField object>, 'role': <django.forms.fields.CharField object>, 'since': <django.forms.fields.DateField object>, 'until': <django.forms.fields.DateField object>}¶
-
declared_fields= {'member': <django.forms.models.ModelChoiceField object>}¶
-
property
media¶ Return all media required to render the widgets on this form.
-
activemembers.gsuite module¶
-
class
activemembers.gsuite.GSuiteUserService(directory_api=None)[source]¶ Bases:
object-
create_user(member: members.models.member.Member)[source]¶ Create a new GSuite user based on the provided data.
- Parameters
member – The member that gets an account
:return returns a tuple with the password and id of the created user
-
delete_user(email)[source]¶ Delete the user from GSuite.
- Parameters
email – primary email of the user
-
property
directory_api¶
-
suspend_user(username)[source]¶ Suspend the user in GSuite.
- Parameters
username – username of the user
-
update_user(member: members.models.member.Member, username: str)[source]¶
-
activemembers.models module¶
The models defined by the activemembers package.
-
class
activemembers.models.ActiveMemberGroupManager(*args, **kwargs)[source]¶ Bases:
django.db.models.manager.ManagerReturns active objects only sorted by the localized name.
-
class
activemembers.models.ActiveMembershipManager(*args, **kwargs)[source]¶ Bases:
django.db.models.manager.ManagerCustom manager that gets the currently active membergroup memberships.
-
class
activemembers.models.Board(*args, **kwargs)[source]¶ Bases:
activemembers.models.MemberGroupDescribes a board, which is a type of MemberGroup.
-
exception
DoesNotExist¶
-
exception
MultipleObjectsReturned¶ Bases:
activemembers.models.MemberGroup.MultipleObjectsReturned
-
membergroup_ptr¶ 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.placeis aForwardOneToOneDescriptorinstance.
-
membergroup_ptr_id¶
-
save(**kwargs)[source]¶ Save the current instance. Override this in a subclass if you want to control the saving process.
The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.
-
exception
-
class
activemembers.models.Committee(*args, **kwargs)[source]¶ Bases:
activemembers.models.MemberGroupDescribes a committee, which is a type of MemberGroup.
-
exception
DoesNotExist¶
-
exception
MultipleObjectsReturned¶ Bases:
activemembers.models.MemberGroup.MultipleObjectsReturned
-
active_objects= <activemembers.models.ActiveMemberGroupManager object>¶
-
membergroup_ptr¶ 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.placeis aForwardOneToOneDescriptorinstance.
-
membergroup_ptr_id¶
-
objects= <django.db.models.manager.Manager object>¶
-
exception
-
class
activemembers.models.MemberGroup(*args, **kwargs)[source]¶ Bases:
django.db.models.base.ModelDescribes a groups of members.
-
exception
DoesNotExist¶
-
exception
MultipleObjectsReturned¶
-
active¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
active_objects= <activemembers.models.ActiveMemberGroupManager object>¶
-
board¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurantis aReverseOneToOneDescriptorinstance.
-
clean()[source]¶ Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field defined by NON_FIELD_ERRORS.
-
committee¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurantis aReverseOneToOneDescriptorinstance.
-
property
contact_address¶
-
contact_email¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
contact_mailinglist¶ 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.placeis aForwardOneToOneDescriptorinstance.
-
contact_mailinglist_id¶
-
description¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
display_members¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
event_set¶ Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.childrenis aReverseManyToOneDescriptorinstance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()defined below.
-
eventdocument_set¶ Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.childrenis aReverseManyToOneDescriptorinstance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()defined below.
-
id¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
mailinglist_set¶ Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppingsandTopping.pizzasareManyToManyDescriptorinstances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()defined below.
-
membergroupmembership_set¶ Accessor to the related objects manager on the reverse side of a many-to-one relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Parent.childrenis aReverseManyToOneDescriptorinstance.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()defined below.
-
members¶ Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppingsandTopping.pizzasareManyToManyDescriptorinstances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()defined below.
-
name¶ 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>¶
-
permissions¶ Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.
In the example:
class Pizza(Model): toppings = ManyToManyField(Topping, related_name='pizzas')
Pizza.toppingsandTopping.pizzasareManyToManyDescriptorinstances.Most of the implementation is delegated to a dynamically defined manager class built by
create_forward_many_to_many_manager()defined below.
-
photo¶ Just like the FileDescriptor, but for ImageFields. The only difference is assigning the width/height to the width_field/height_field, if appropriate.
-
since¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
society¶ Accessor to the related object on the reverse side of a one-to-one relation.
In the example:
class Restaurant(Model): place = OneToOneField(Place, related_name='restaurant')
Place.restaurantis aReverseOneToOneDescriptorinstance.
-
until¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
exception
-
class
activemembers.models.MemberGroupMembership(*args, **kwargs)[source]¶ Bases:
django.db.models.base.ModelDescribes a group membership.
-
exception
DoesNotExist¶
-
exception
MultipleObjectsReturned¶
-
active_objects= <activemembers.models.ActiveMembershipManager object>¶
-
chair¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
clean()[source]¶ Hook for doing any extra model-wide validation after clean() has been called on every field by self.clean_fields. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field defined by NON_FIELD_ERRORS.
-
get_next_by_since(*, field=<django.db.models.fields.DateField: since>, is_next=True, **kwargs)¶
-
get_previous_by_since(*, field=<django.db.models.fields.DateField: since>, is_next=False, **kwargs)¶
-
group¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parentis aForwardManyToOneDescriptorinstance.
-
group_id¶
-
id¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
property
initial_connected_membership¶ Find the oldest membership directly connected to the current one.
-
property
is_active¶ Is this membership currently active.
-
property
latest_connected_membership¶ Find the newest membership directly connected to the current one.
(thus the membership that started at the moment the current one ended).
-
member¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parentis aForwardManyToOneDescriptorinstance.
-
member_id¶
-
objects= <django.db.models.manager.Manager object>¶
-
role¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
save(**kwargs)[source]¶ Save the current instance. Override this in a subclass if you want to control the saving process.
The ‘force_insert’ and ‘force_update’ parameters can be used to insist that the “save” must be an SQL insert or update (or equivalent for non-SQL backends), respectively. Normally, they should not be set.
-
since¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
until¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
exception
-
class
activemembers.models.Mentorship(*args, **kwargs)[source]¶ Bases:
django.db.models.base.ModelDescribe a mentorship during the orientation.
-
exception
DoesNotExist¶
-
exception
MultipleObjectsReturned¶
-
id¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
member¶ Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.
In the example:
class Child(Model): parent = ForeignKey(Parent, related_name='children')
Child.parentis aForwardManyToOneDescriptorinstance.
-
member_id¶
-
objects= <django.db.models.manager.Manager object>¶
-
year¶ A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.
-
exception
-
class
activemembers.models.Society(*args, **kwargs)[source]¶ Bases:
activemembers.models.MemberGroupDescribes a society, which is a type of MemberGroup.
-
exception
DoesNotExist¶
-
exception
MultipleObjectsReturned¶ Bases:
activemembers.models.MemberGroup.MultipleObjectsReturned
-
active_objects= <activemembers.models.ActiveMemberGroupManager object>¶
-
membergroup_ptr¶ 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.placeis aForwardOneToOneDescriptorinstance.
-
membergroup_ptr_id¶
-
objects= <django.db.models.manager.Manager object>¶
-
exception
activemembers.services module¶
activemembers.signals module¶
The signals defined by the activemembers package.
activemembers.sitemaps module¶
-
class
activemembers.sitemaps.BoardSitemap[source]¶ Bases:
django.contrib.sitemaps.Sitemap-
changefreq= 'yearly'¶
-
activemembers.urls module¶
The routes defined by the activemembers package.
activemembers.views module¶
-
class
activemembers.views.BoardDetailView(**kwargs)[source]¶ Bases:
activemembers.views._MemberGroupDetailViewView that renders the page of one selected board.
-
context_object_name= 'membergroup'¶
-
get_object(queryset=None) → activemembers.models.Board[source]¶ Return the object the view is displaying.
Require self.queryset and a pk or slug argument in the URLconf. Subclasses can override this to return any object.
-
template_name= 'activemembers/board_detail.html'¶
-
-
class
activemembers.views.BoardIndexView(**kwargs)[source]¶ Bases:
django.views.generic.list.ListViewView that renders the board overview page.
-
context_object_name= 'old_boards'¶
-
current_board= None¶
-
get_queryset() → django.db.models.query.QuerySet[source]¶ Return the list of items for this view.
The return value must be an iterable and may be an instance of QuerySet in which case QuerySet specific behavior will be enabled.
-
template_name= 'activemembers/board_index.html'¶
-
-
class
activemembers.views.CommitteeDetailView(**kwargs)[source]¶ Bases:
activemembers.views._MemberGroupDetailViewView that renders the page of one selected committee.
-
model¶ alias of
activemembers.models.Committee
-
template_name= 'activemembers/committee_detail.html'¶
-
-
class
activemembers.views.CommitteeIndexView(**kwargs)[source]¶ Bases:
django.views.generic.list.ListViewView that renders the committee overview page.
-
context_object_name= 'committees'¶
-
queryset= <activemembers.models.ActiveMemberGroupManager object>¶
-
template_name= 'activemembers/committee_index.html'¶
-
-
class
activemembers.views.SocietyDetailView(**kwargs)[source]¶ Bases:
activemembers.views._MemberGroupDetailViewView that renders the page of one selected society.
-
model¶ alias of
activemembers.models.Society
-
template_name= 'activemembers/society_detail.html'¶
-
-
class
activemembers.views.SocietyIndexView(**kwargs)[source]¶ Bases:
django.views.generic.list.ListViewView that renders the societies overview page.
-
context_object_name= 'societies'¶
-
queryset= <activemembers.models.ActiveMemberGroupManager object>¶
-
template_name= 'activemembers/society_index.html'¶
-