Private
Public Access
1
0
Files
rowsandall/rowers/management/commands/repairstrokedata.py
Sander Roosendaal 3c2454cb3e more pep
2022-02-17 11:39:13 +01:00

29 lines
822 B
Python

#!/srv/venv/bin/python
import sys
import os
from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
import time
from rowers.models import (
Workout, User, Rower, WorkoutForm,
RowerForm, GraphImage, AdvancedWorkoutForm)
from django.core.files.base import ContentFile
from rowsandall_app.settings import BASE_DIR
from rowers.dataprep import *
# If you find a solution that does not need the two paths, please comment!
sys.path.append('$path_to_root_of_project$')
sys.path.append('$path_to_root_of_project$/$project_name$')
os.environ['DJANGO_SETTINGS_MODULE'] = '$project_name$.settings'
class Command(BaseCommand):
def handle(self, *args, **options):
repair_data(verbose=True)
self.stdout.write(self.style.SUCCESS('Successfully cleaned data'))