from django.db import models

from vbv_lernwelt.core.models import User


class CourseSessionGroup(models.Model):
    name = models.CharField(max_length=255)

    course = models.ForeignKey("course.Course", on_delete=models.CASCADE)

    course_session = models.ManyToManyField(
        "course.CourseSession",
        blank=True,
    )

    supervisor = models.ManyToManyField(
        User,
        blank=True,
    )

    class Meta:
        ordering = ["name"]

    def __str__(self):
        return self.name
