Small fixes for Warnings found by PyCharm, mostly spellingerrors.

This commit is contained in:
2023-08-01 14:38:32 +02:00
parent ef00fc25f7
commit c62d2ee010
50 changed files with 294 additions and 385 deletions

View File

@@ -74,12 +74,13 @@ class HanchanManager(models.Manager):
[hanchan.get_playerdata(user) for hanchan in queryset]
return queryset
def season_hanchans(self, user=None, season=None, until=None):
def season_hanchans(self, user: object = None, season: int = None, until: date = None):
"""Return all Hanchans that belong to a given or the current season.
:param user: Only return Hanchans where this user participated.
:param season: the year of the wanted season, current year if None.
:return: QuerySet Object
:param season: the year of the wanted season, current year if None.
:param until: only return hanchans played until the given date.
:return: QuerySet Object
"""
try:
season = season or until.year
@@ -92,6 +93,7 @@ class HanchanManager(models.Manager):
:param user: Return Hanchans where this user participated.
:param since: only return Hanchans played since the given datetime
:param until: only return hanchans played until the given date.
:param filter_args: To add specific arguments to the Django filter.
:return: a QuerySet Object
"""
@@ -199,10 +201,8 @@ class SeasonRankingManager(models.Manager):
class KyuDanRankingManager(models.Manager):
def json_data(self):
""" Get all Rankings for a given Season and return them as a list of
dict objects, suitable for JSON exports and other processings.
:param season: Season that should be exported, current season if empty
:return: a list() of dict() objects suiteable for JSON export.
dict objects, suitable for JSON exports and other processing.
:return: a list() of dict() objects suitable for JSON export.
"""
json_data = list()
values = self.all()