courseFeedback.py 987 Bytes
Newer Older
1
from django.core.validators import MaxValueValidator, MinValueValidator
2
from django.db import models
3

4 5
from backend_app.models.abstract.essentialModule import EssentialModule
from backend_app.models.course import Course
6
from backend_app.models.language import Language
7 8 9


class CourseFeedback(EssentialModule):
10 11 12
    course = models.OneToOneField(
        Course, on_delete=models.CASCADE, default=0, related_name="course_feedback"
    )
13 14 15
    language = models.ForeignKey(
        Language, on_delete=models.SET_NULL, related_name="courses", null=True
    )
16 17
    comment = models.TextField(null=True, max_length=1500)
    adequation = models.IntegerField(
18
        default=0, validators=[MaxValueValidator(5), MinValueValidator(-5)]
19 20
    )
    working_dose = models.IntegerField(
21
        default=0, validators=[MaxValueValidator(5), MinValueValidator(-5)]
22 23
    )
    language_following_ease = models.IntegerField(
24
        default=0, validators=[MaxValueValidator(5), MinValueValidator(-5)]
25
    )