from django.db import models
from teacher.models import Teacher
from module.models import Module

# Create your models here.
class TeacherModule(models.Model):
    teacher = models.ForeignKey(Teacher,on_delete=models.CASCADE)
    module = models.ForeignKey(Module,on_delete=models.CASCADE)
    has_checked = models.BooleanField(default=False)

    # class Meta:
    #     unique_together = ('teacher_id', 'module_id')
    #one module can be used tought to 2 different classes

    def __str__(self):
        return f"Id: {self.id}, { self.teacher} {self.module}"