Views
ClubAdminEditForm
¶
Bases: ClubEditForm
ClubEditForm
¶
Bases: ModelForm
ClubMemberForm(*args, **kwargs)
¶
Bases: Form
Form handling the members of a club.
Source code in club/forms.py
clean_users()
¶
Check that the user is not trying to add an user already in the club.
Also check that the user is valid and has a valid subscription.
Source code in club/forms.py
clean()
¶
Check user rights for adding an user.
Source code in club/forms.py
MailingForm(club_id, user_id, mailings, *args, **kwargs)
¶
Bases: Form
Form handling mailing lists right.
Source code in club/forms.py
check_required(cleaned_data, field)
¶
If the given field doesn't exist or has no value, add a required error on it.
clean_subscription_users()
¶
Convert given users into real users and check their validity.
Source code in club/forms.py
SellingsForm(club, *args, **kwargs)
¶
Bases: Form
Source code in club/forms.py
Club
¶
Bases: Model
The Club class, made as a tree to allow nice tidy organization.
president()
¶
Fetch the membership of the current president of this club.
check_loop()
¶
Raise a validation error when a loop is found within the parent list.
Source code in club/models.py
is_owned_by(user)
¶
Method to see if that object can be super edited by the given user.
can_be_edited_by(user)
¶
can_be_viewed_by(user)
¶
get_membership_for(user)
¶
Return the current membership the given user.
Note
The result is cached.
Source code in club/models.py
Mailing
¶
Bases: Model
A Mailing list for a club.
Warning
Remember that mailing lists should be validated by UTBM.
MailingSubscription
¶
Bases: Model
Link between user and mailing list.
Membership
¶
Bases: Model
The Membership class makes the connection between User and Clubs.
Both Users and Clubs can have many Membership objects
- a user can be a member of many clubs at a time
- a club can have many members at a time too
A User is currently member of all the Clubs where its Membership has an end_date set to null/None. Otherwise, it's a past membership kept because it can be very useful to see who was in which Club in the past.
ClubTabsMixin
¶
Bases: TabedViewMixin
ClubListView
¶
Bases: ListView
List the Clubs.
ClubView
¶
ClubPageEditView
¶
Bases: ClubTabsMixin
, PageEditViewBase
ClubPageHistView
¶
ClubToolsView
¶
ClubMembersView
¶
Bases: ClubTabsMixin
, CanViewMixin
, DetailFormView
View of a club's members.
form_valid(form)
¶
Check user rights.
Source code in club/views.py
ClubOldMembersView
¶
ClubSellingView
¶
ClubSellingCSVView
¶
Bases: ClubSellingView
Generate sellings in csv for a given period.
ClubEditView
¶
Bases: ClubTabsMixin
, CanEditMixin
, UpdateView
Edit a Club.
Regular club board members will be able to edit the main infos (like the logo and the description). Admins will also be able to edit the club properties (like the name and the parent club).
ClubCreateView
¶
Bases: PermissionRequiredMixin
, CreateView
Create a club (for the Sith admin).
MembershipSetOldView
¶
MembershipDeleteView
¶
Bases: PermissionRequiredMixin
, DeleteView
Delete a membership (for admins only).
ClubMailingView
¶
Bases: ClubTabsMixin
, CanEditMixin
, DetailFormView
A list of mailing for a given club.
add_new_mailing(cleaned_data)
¶
Create a new mailing list from the form.
Source code in club/views.py
add_new_subscription(cleaned_data)
¶
Add mailing subscriptions for each user given and/or for the specified email in form.
Source code in club/views.py
remove_subscription(cleaned_data)
¶
Remove specified users from a mailing list.
MailingDeleteView
¶
Bases: CanEditMixin
, DeleteView
MailingSubscriptionDeleteView
¶
Bases: CanEditMixin
, DeleteView
MailingAutoGenerationView
¶
Bases: View