1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-21 01:48:21 +02:00
This commit is contained in:
Yohann D'ANELLO
2020-04-11 23:02:12 +02:00
parent a186ccbb26
commit 31d2224b8f
15 changed files with 257 additions and 7 deletions

View File

@ -1,23 +1,32 @@
# Copyright (C) 2018-2020 by BDE ENS Paris-Saclay
# SPDX-License-Identifier: GPL-3.0-or-later
import json
from django.contrib.auth.models import User
from django.db import models
from django.utils.translation import gettext_lazy as _
from member.models import Role, Club, Membership
from note.models import NoteSpecial
class WEIClub(Club):
"""
The WEI is a club. Register to the WEI is equivalent than be member of the club.
"""
year = models.PositiveIntegerField(
unique=True,
verbose_name=_("year"),
)
date_start = models.DateField(
verbose_name=_("date start"),
)
date_end = models.DateField(
verbose_name=_("date end"),
)
def update_membership_dates(self):
"""
We can't join the WEI next years.
@ -84,6 +93,8 @@ class WEIRole(Role):
bus = models.ForeignKey(
Bus,
on_delete=models.CASCADE,
null=True,
default=None,
related_name="roles",
verbose_name=_("bus"),
)