Jarvis/jarvis/followup/management/commands/set_theorical_intensity.py

31 lines
955 B
Python

"""This command manages Closure Tables implementation
It adds new levels and cleans links between Educatives.
This way, it's relatively easy to fetch an entire tree with just one tiny request.
"""
import pendulum
from django.core.management.base import BaseCommand
from jarvis.followup.models import Intensity
class Command(BaseCommand):
def handle(self, *args, **options):
today = pendulum.date(2024, 1, 31)
intensity_list = Intensity.objects.filter(date__lte=today)
count = 0
for intensity in intensity_list:
count += 1
intensity.theorical_time = intensity.time
intensity.difficulty_asked = intensity.difficulty
intensity.number_of_passes_asked = 21
intensity.quantity_of_skill_asked = intensity.quantity_of_skill
intensity.number_of_gymnast = 2
intensity.save()
print(f"Traitement de {count} intensité terminés")