# Path: annotation_tool/models.py
# class Project(models.Model):
# class Class(models.Model):
#     class Meta:
# class ClassInstance(models.Model):
#     class Meta:
# class Wav(models.Model):
# class Segment(models.Model):
# class Annotation(models.Model):
#     class Meta:
# class Event(models.Model):
#     class Meta:
# class Region(models.Model):
#     class Meta:
# class ClassProminence(models.Model):
#     class Meta:
# class Tag(models.Model):
# class Log(models.Model):
#     def __str__(self):
#     def __str__(self):
# def get_wav_file_path(self, filename):
#     def __str__(self):
# def auto_delete_file_on_delete(sender, instance, **kwargs):
#     def get_project(self):
#     def __str__(self):
#     def get_project(self):
#     def __str__(self):
#     def get_project(self):
#     def __str__(self):
#     def get_project(self):
#     def __str__(self):
#     def __str__(self):
#     def get_tag_names():
#     def __str__(self):
#     def __str__(self):
#     FINISHED = 'finished'
#     UNFINISHED = 'unfinished'
#     STATUS_CHOICES = (
#         (FINISHED, FINISHED),
#         (UNFINISHED, UNFINISHED)
#     )
#     VERY_LOW = 1
#     LOW = 2
#     MID = 3
#     LOUD = 4
#     VERY_LOUD = 5
#     PROMINENCE_CHOICES = (
#         (VERY_LOW, ''),
#         (LOW, ''),
#         (MID, ''),
#         (LOUD, ''),
#         (VERY_LOUD, 'Most salient')
#     )


from django.contrib.auth.models import User
from django.db.models import Q
from rest_framework import serializers
from django.utils import timezone
from aiorest_ws.utils.fields import to_choices_dict, flatten_choices_dict
from annotation_tool import models
import colorsys


class ProjectSerializer(serializers.Serializer):
    project_name = serializers.CharField(label='Project name', max_length=50)
    overlap = serializers.BooleanField(label='Allow class overlap in this project', default=False)
    classes = serializers.MultipleChoiceField(choices=[])

    # Creation of the project and the required ClassInstance objects
    def create(self, validated_data):

# Path: annotation_tool/models.py
# class Project(models.Model):
# class Class(models.Model):
#     class Meta:
# class ClassInstance(models.Model):
#     class Meta:
# class Wav(models.Model):
# class Segment(models.Model):
# class Annotation(models.Model):
#     class Meta:
# class Event(models.Model):
#     class Meta:
# class Region(models.Model):
#     class Meta:
# class ClassProminence(models.Model):
#     class Meta:
# class Tag(models.Model):
# class Log(models.Model):
#     def __str__(self):
#     def __str__(self):
# def get_wav_file_path(self, filename):
#     def __str__(self):
# def auto_delete_file_on_delete(sender, instance, **kwargs):
#     def get_project(self):
#     def __str__(self):
#     def get_project(self):
#     def __str__(self):
#     def get_project(self):
#     def __str__(self):
#     def get_project(self):
#     def __str__(self):
#     def __str__(self):
#     def get_tag_names():
#     def __str__(self):
#     def __str__(self):
#     FINISHED = 'finished'
#     UNFINISHED = 'unfinished'
#     STATUS_CHOICES = (
#         (FINISHED, FINISHED),
#         (UNFINISHED, UNFINISHED)
#     )
#     VERY_LOW = 1
#     LOW = 2
#     MID = 3
#     LOUD = 4
#     VERY_LOUD = 5
#     PROMINENCE_CHOICES = (
#         (VERY_LOW, ''),
#         (LOW, ''),
#         (MID, ''),
#         (LOUD, ''),
#         (VERY_LOUD, 'Most salient')
#     )


# Path: annotation_tool/serializers.py
from django.contrib.auth.models import User
from django.db.models import Q
from rest_framework import serializers
from django.utils import timezone
from aiorest_ws.utils.fields import to_choices_dict, flatten_choices_dict
from annotation_tool import models
import colorsys



class ProjectSerializer(serializers.Serializer):
    project_name = serializers.CharField(label='Project name', max_length=50)
    overlap = serializers.BooleanField(label='Allow class overlap in this project', default=False)
    classes = serializers.MultipleChoiceField(choices=[])

    # Creation of the project and the required ClassInstance objects
    def create(self, validated_data):

        project = models.Project(name=validated_data['project_name'],