This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# WR 45.34% is enough to keep your ground. | |
# WR 50% gains 0.125 stars per battle on average. | |
def get_streak_points(num_wins): | |
if num_wins < 3: | |
return num_wins | |
return num_wins * 2 - 2 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
class AnnotateByMixin(): | |
"""Mixin that allows adding predefined annotations to queryset. | |
Example: | |
class DialogQuerySet(AnnotateByMixin, models.QuerySet): | |
predefined_annotations = { |