# Generated by uml2django - 
# https://steelkiwi.com/blog/best-practices-working-django-models-python/
# https://learndjango.com/tutorials/django-best-practices-models
from django.db import models
from django.utils.translation import gettext_lazy as _
from django.urls import reverse

class SubjectLevel(
    models.Model
):
    subject = models.ForeignKey(
        'Subject',
        verbose_name=_('subject'),
        help_text=_('subject help text'),
        on_delete=models.PROTECT,
    )
    title = models.CharField(
        max_length=255,
        verbose_name=_('title'),
        help_text=_('title help text'),
    )
    description = models.TextField(
        verbose_name=_('description'),
        help_text=_('description help text'),
    )


    class Meta:
        verbose_name = _("subjectlevel")
        verbose_name_plural = _("subjectlevels")
        unique_together = (
            'subject',
            'title',
        )

    # def __str__(self): 
    #     return self.

    def get_absolute_url(self):
        return reverse("subjectlevel-detail", args=[str(self.id)])
