# Path: velo/core/models.py
# class Log(models.Model):
#     content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE, null=True, blank=True)
#     object_id = models.PositiveIntegerField(null=True, blank=True)
#     content_object = GenericForeignKey('content_type', 'object_id')
# 
#     user = models.ForeignKey(User, null=True, blank=True)
#     action = models.CharField(max_length=50, blank=True)
#     message = models.CharField(max_length=255, blank=True)
#     params = JSONField(blank=True, null=True)
# 
#     created = models.DateTimeField(auto_now_add=True)
#     modified = models.DateTimeField(auto_now=True)
# 
#     def set_message(self, message, commit=True):
#         self.message = message
#         if commit:
#             self.save()
# 
#     def set_object(self, obj, commit=True):
#         self.content_object = obj
#         if commit:
#             self.save()
# 
# Path: velo/velo/utils.py
# def load_class(full_class_string):
#     """
#     dynamically load a class from a string
#     """
# 
#     class_data = full_class_string.split(".")
#     module_path = ".".join(class_data[:-1])
#     class_str = class_data[-1]
# 
#     module = importlib.import_module(module_path)
#     # Finally, we retrieve the Class
#     return getattr(module, class_str)


from django.db import models, transaction
from django.db.models import signals
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.utils.translation import ugettext_lazy as _
from django_celery_beat.models import PeriodicTask, PeriodicTasks, CrontabSchedule
from easy_thumbnails.fields import ThumbnailerImageField
from slugify import slugify
from velo.core.models import Log
from velo.core.utils import restart_celerybeat
from velo.results.helper import time_to_seconds
from velo.velo.mixins.models import TimestampMixin
from velo.velo.utils import load_class
import os
import time
import datetime
import uuid

    participant_slug = models.SlugField(blank=True)
    participant = models.ForeignKey('registration.Participant', related_name='primary_%(class)s_set', )  # Should be automatically updated to first participant in competition series.

    group_points1 = models.IntegerField('1.', blank=True, null=True)
    group_points2 = models.IntegerField('2.', blank=True, null=True)
    group_points3 = models.IntegerField('3.', blank=True, null=True)
    group_points4 = models.IntegerField('4.', blank=True, null=True)
    group_points5 = models.IntegerField('5.', blank=True, null=True)
    group_points6 = models.IntegerField('6.', blank=True, null=True)
    group_points7 = models.IntegerField('7.', blank=True, null=True)
    group_points8 = models.IntegerField('8.', blank=True, null=True)

    group_total = models.IntegerField(blank=True, null=True)
    group_place = models.IntegerField(blank=True, null=True)

    distance_points1 = models.IntegerField('1.', blank=True, null=True)
    distance_points2 = models.IntegerField('2.', blank=True, null=True)
    distance_points3 = models.IntegerField('3.', blank=True, null=True)
    distance_points4 = models.IntegerField('4.', blank=True, null=True)
    distance_points5 = models.IntegerField('5.', blank=True, null=True)
    distance_points6 = models.IntegerField('6.', blank=True, null=True)
    distance_points7 = models.IntegerField('7.', blank=True, null=True)
    distance_points8 = models.IntegerField('8.', blank=True, null=True)

    distance_place1 = models.IntegerField('1.', blank=True, null=True)
    distance_place2 = models.IntegerField('2.', blank=True, null=True)
    distance_place3 = models.IntegerField('3.', blank=True, null=True)
    distance_place4 = models.IntegerField('4.', blank=True, null=True)
    distance_place5 = models.IntegerField('5.', blank=True, null=True)

# Path: velo/core/models.py
# class Log(models.Model):
#     content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE, null=True, blank=True)
#     object_id = models.PositiveIntegerField(null=True, blank=True)
#     content_object = GenericForeignKey('content_type', 'object_id')
# 
#     user = models.ForeignKey(User, null=True, blank=True)
#     action = models.CharField(max_length=50, blank=True)
#     message = models.CharField(max_length=255, blank=True)
#     params = JSONField(blank=True, null=True)
# 
#     created = models.DateTimeField(auto_now_add=True)
#     modified = models.DateTimeField(auto_now=True)
# 
#     def set_message(self, message, commit=True):
#         self.message = message
#         if commit:
#             self.save()
# 
#     def set_object(self, obj, commit=True):
#         self.content_object = obj
#         if commit:
#             self.save()
# 
# Path: velo/velo/utils.py
# def load_class(full_class_string):
#     """
#     dynamically load a class from a string
#     """
# 
#     class_data = full_class_string.split(".")
#     module_path = ".".join(class_data[:-1])
#     class_str = class_data[-1]
# 
#     module = importlib.import_module(module_path)
#     # Finally, we retrieve the Class
#     return getattr(module, class_str)


# Path: velo/results/models.py
from django.db import models, transaction
from django.db.models import signals
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.utils.translation import ugettext_lazy as _
from django_celery_beat.models import PeriodicTask, PeriodicTasks, CrontabSchedule
from easy_thumbnails.fields import ThumbnailerImageField
from slugify import slugify
from velo.core.models import Log
from velo.core.utils import restart_celerybeat
from velo.results.helper import time_to_seconds
from velo.velo.mixins.models import TimestampMixin
from velo.velo.utils import load_class
import os
import time
import datetime
import uuid


    participant_slug = models.SlugField(blank=True)
    participant = models.ForeignKey('registration.Participant', related_name='primary_%(class)s_set', )  # Should be automatically updated to first participant in competition series.

    group_points1 = models.IntegerField('1.', blank=True, null=True)
    group_points2 = models.IntegerField('2.', blank=True, null=True)
    group_points3 = models.IntegerField('3.', blank=True, null=True)
    group_points4 = models.IntegerField('4.', blank=True, null=True)
    group_points5 = models.IntegerField('5.', blank=True, null=True)
    group_points6 = models.IntegerField('6.', blank=True, null=True)
    group_points7 = models.IntegerField('7.', blank=True, null=True)
    group_points8 = models.IntegerField('8.', blank=True, null=True)

    group_total = models.IntegerField(blank=True, null=True)
    group_place = models.IntegerField(blank=True, null=True)

    distance_points1 = models.IntegerField('1.', blank=True, null=True)
    distance_points2 = models.IntegerField('2.', blank=True, null=True)
    distance_points3 = models.IntegerField('3.', blank=True, null=True)
    distance_points4 = models.IntegerField('4.', blank=True, null=True)
    distance_points5 = models.IntegerField('5.', blank=True, null=True)
    distance_points6 = models.IntegerField('6.', blank=True, null=True)
    distance_points7 = models.IntegerField('7.', blank=True, null=True)
    distance_points8 = models.IntegerField('8.', blank=True, null=True)

    distance_place1 = models.IntegerField('1.', blank=True, null=True)
    distance_place2 = models.IntegerField('2.', blank=True, null=True)
    distance_place3 = models.IntegerField('3.', blank=True, null=True)
    distance_place4 = models.IntegerField('4.', blank=True, null=True)
    distance_place5 = models.IntegerField('5.', blank=True, null=True)

    distance_place6 = models.IntegerField('6.', blank=True, null=True)