|
|
|
@ -1,3 +1,4 @@ |
|
|
|
|
|
|
|
from zoneinfo import ZoneInfo |
|
|
|
from django.db import models |
|
|
|
from django.db import models |
|
|
|
from typing import TYPE_CHECKING |
|
|
|
from typing import TYPE_CHECKING |
|
|
|
if TYPE_CHECKING: |
|
|
|
if TYPE_CHECKING: |
|
|
|
@ -7,6 +8,8 @@ from . import Event, TournamentPayment, FederalMatchCategory, FederalCategory, F |
|
|
|
import uuid |
|
|
|
import uuid |
|
|
|
from django.utils import timezone, formats |
|
|
|
from django.utils import timezone, formats |
|
|
|
from datetime import datetime, timedelta |
|
|
|
from datetime import datetime, timedelta |
|
|
|
|
|
|
|
from zoneinfo import ZoneInfo |
|
|
|
|
|
|
|
|
|
|
|
from shared.cryptography import encryption_util |
|
|
|
from shared.cryptography import encryption_util |
|
|
|
from ..utils.extensions import plural_format |
|
|
|
from ..utils.extensions import plural_format |
|
|
|
|
|
|
|
|
|
|
|
@ -129,6 +132,12 @@ class Tournament(models.Model): |
|
|
|
components.append(self.name) |
|
|
|
components.append(self.name) |
|
|
|
return (' ').join(components) |
|
|
|
return (' ').join(components) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def timezone(self): |
|
|
|
|
|
|
|
tz = 'CET' |
|
|
|
|
|
|
|
if self.event and self.event.club: |
|
|
|
|
|
|
|
tz = self.event.club.timezone |
|
|
|
|
|
|
|
return ZoneInfo(tz) |
|
|
|
|
|
|
|
|
|
|
|
def level(self): |
|
|
|
def level(self): |
|
|
|
if self.federal_level_category == 0: |
|
|
|
if self.federal_level_category == 0: |
|
|
|
return "Anim." |
|
|
|
return "Anim." |
|
|
|
|