teams package#
Subpackages#
Submodules#
teams.admin module#
- class teams.admin.LanguageInline(parent_model, admin_site)#
Bases:
TabularInline
- class teams.admin.RoleAdmin(model, admin_site)#
Bases:
ModelAdmin
teams.forms module#
- class teams.forms.EditMemberRoleForm(roles, *args, **kwargs)#
Bases:
Form
- property media#
Return all media required to render the widgets on this form.
- class teams.forms.EditTeamDetailsForm(user, *args, **kwargs)#
Bases:
ModelForm
- property media#
Return all media required to render the widgets on this form.
- save(*args, **kwargs)#
Save this form’s self.instance object if commit=True. Otherwise, add a save_m2m() method to the form which can be called after the instance is saved manually at a later time. Return the model instance.
teams.models module#
- class teams.models.FakeTeam(language)#
Bases:
object
This is a class replacing a Team object when a language has no team attached.
- class teams.models.Role(*args, **kwargs)#
Bases:
Model
This is the intermediary class between Person and Team to attribute roles to Team members.
- exception DoesNotExist#
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned#
Bases:
MultipleObjectsReturned
- classmethod inactivate_unused_roles()#
Inactivate the roles when login older than 180 days
- class teams.models.Team(*args, **kwargs)#
Bases:
Model
The lang_code is generally used for the name of the team.
- exception DoesNotExist#
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned#
Bases:
MultipleObjectsReturned
- can_edit(user)#
Return True if user is allowed to edit this team user is a User (from request.user), not a Person
- fill_role(role, person)#
Used by TeamManager to prefill roles in team
- get_inactive_members()#
Return the inactive members
- get_members_by_role_exact(role, only_active=True)#
Return a list of active members
- get_members_by_roles(roles, only_active=True)#
Requires a list of roles in argument
- get_translators()#
Don’t use get_members_by_roles to provide an optimization
- send_mail_to_coordinator(subject, message, messagekw=None)#
Send a message to the coordinator, in her language if available and if subject and message are lazy strings
teams.views module#
- teams.views.context_data_for_view_get_person_teams_from_request(request: HttpRequest) dict[str, Any] #
Create context data (a dictionary with key and values to give to a template) with the teams of the current connected user, if any.
The resulting dict will contain three keys: user_teams, user_teams_suggestions, user_teams_all.