mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-10 03:49:24 +00:00
use google convention for docstrings
This commit is contained in:
@ -45,8 +45,8 @@ class AvailableTrombiManager(models.Manager):
|
||||
|
||||
|
||||
class Trombi(models.Model):
|
||||
"""
|
||||
This is the main class, the Trombi itself.
|
||||
"""Main class of the trombi, the Trombi itself.
|
||||
|
||||
It contains the deadlines for the users, and the link to the club that makes
|
||||
its Trombi.
|
||||
"""
|
||||
@ -103,10 +103,10 @@ class Trombi(models.Model):
|
||||
|
||||
|
||||
class TrombiUser(models.Model):
|
||||
"""
|
||||
This class is only here to avoid cross references between the core, club,
|
||||
and trombi modules. It binds a User to a Trombi without needing to import
|
||||
Trombi into the core.
|
||||
"""Bound between a `User` and a `Trombi`.
|
||||
|
||||
This class is here to avoid cross-references between the core, club,
|
||||
and trombi modules.
|
||||
It also adds the pictures to the profile without needing all the security
|
||||
like the other SithFiles.
|
||||
"""
|
||||
@ -172,10 +172,7 @@ class TrombiUser(models.Model):
|
||||
|
||||
|
||||
class TrombiComment(models.Model):
|
||||
"""
|
||||
This represent a comment given by someone to someone else in the same Trombi
|
||||
instance.
|
||||
"""
|
||||
"""A comment given by someone to someone else in the same Trombi instance."""
|
||||
|
||||
author = models.ForeignKey(
|
||||
TrombiUser,
|
||||
@ -202,9 +199,7 @@ class TrombiComment(models.Model):
|
||||
|
||||
|
||||
class TrombiClubMembership(models.Model):
|
||||
"""
|
||||
This represent a membership to a club
|
||||
"""
|
||||
"""A membership in a club."""
|
||||
|
||||
user = models.ForeignKey(
|
||||
TrombiUser,
|
||||
|
@ -94,9 +94,7 @@ class TrombiTabsMixin(TabedViewMixin):
|
||||
|
||||
|
||||
class UserIsInATrombiMixin(View):
|
||||
"""
|
||||
This view check if the requested user has a trombi_user attribute
|
||||
"""
|
||||
"""Check if the requested user has a trombi_user attribute."""
|
||||
|
||||
def dispatch(self, request, *args, **kwargs):
|
||||
if not hasattr(self.request.user, "trombi_user"):
|
||||
@ -118,18 +116,14 @@ class TrombiForm(forms.ModelForm):
|
||||
|
||||
|
||||
class TrombiCreateView(CanCreateMixin, CreateView):
|
||||
"""
|
||||
Create a trombi for a club
|
||||
"""
|
||||
"""Create a trombi for a club."""
|
||||
|
||||
model = Trombi
|
||||
form_class = TrombiForm
|
||||
template_name = "core/create.jinja"
|
||||
|
||||
def post(self, request, *args, **kwargs):
|
||||
"""
|
||||
Affect club
|
||||
"""
|
||||
"""Affect club."""
|
||||
form = self.get_form()
|
||||
if form.is_valid():
|
||||
club = get_object_or_404(Club, id=self.kwargs["club_id"])
|
||||
@ -304,9 +298,7 @@ class UserTrombiForm(forms.Form):
|
||||
class UserTrombiToolsView(
|
||||
QuickNotifMixin, TrombiTabsMixin, UserIsLoggedMixin, TemplateView
|
||||
):
|
||||
"""
|
||||
Display a user's trombi tools
|
||||
"""
|
||||
"""Display a user's trombi tools."""
|
||||
|
||||
template_name = "trombi/user_tools.jinja"
|
||||
current_tab = "tools"
|
||||
@ -466,9 +458,7 @@ class UserTrombiProfileView(TrombiTabsMixin, DetailView):
|
||||
|
||||
|
||||
class TrombiCommentFormView(LoginRequiredMixin, View):
|
||||
"""
|
||||
Create/edit a trombi comment
|
||||
"""
|
||||
"""Create/edit a trombi comment."""
|
||||
|
||||
model = TrombiComment
|
||||
fields = ["content"]
|
||||
|
Reference in New Issue
Block a user