feat(tenancy): add Season current-season lookup and year name
Complete the Season model: - name property renders the start/end years as a "YY-YY" label (e.g. "25-26") via strftime %y, and __str__ now returns it. - get_current(date) returns the active club's season covering the given date (today by default), inclusive of both boundaries, scoped through the tenant queryset so it never crosses clubs. Rename the tenant queryset's current() to current_club() for clarity and update callers/tests. Cover the new behaviour; tenancy modules stay at 100%. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -13,7 +13,7 @@ class TenantQuerySet(models.QuerySet):
|
||||
def for_club(self, club: Club):
|
||||
return self.filter(club=club)
|
||||
|
||||
def current(self):
|
||||
def current_club(self):
|
||||
return self.filter(club=require_current_club())
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user