Another Step in the Quest to clean up the code base.
This commit is contained in:
18
src/mahjong_ranking/management/commands/update_ranking.py
Normal file
18
src/mahjong_ranking/management/commands/update_ranking.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
Recalculate Mahjong Rankings...
|
||||
"""
|
||||
|
||||
from django.core.management.base import BaseCommand
|
||||
from mahjong_ranking import models
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
""" Recalculate all Kyu/Dan Rankings """
|
||||
|
||||
help = "Recalculate all Kyu/Dan Rankings"
|
||||
|
||||
def handle(self, *args, **options):
|
||||
for ranking in models.KyuDanRanking.objects.all():
|
||||
ranking.recalculate()
|
||||
Reference in New Issue
Block a user