Private
Public Access
1
0

first version of autojoin (just collecting workouts)

This commit is contained in:
Sander Roosendaal
2020-05-14 08:16:38 +02:00
parent 748f12e44a
commit 9e3b12df57
2 changed files with 29 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
import sys
import os
import requests
import datetime
import arrow
from django.utils import timezone
from django.core.management.base import BaseCommand
from rowers.models import Rower,Workout
class Command(BaseCommand):
def handle(self, *args, **options):
rs = (r for r in Rower.objects.all() if r.ispaid and r.autojoin)
now = timezone.now()
for r in rs:
workouts = Workout.objects.filter(user=r,
startdatetime__gte=timezone.now()-datetime.timedelta(days=2))
print('ready autojoin')