from django.db import models
from .faculty import Faculty


class SubjectArea(models.Model):
    """A class that inherits from the model class which 
    create a SubjectArea model.This SubjectArea model 
    defines a datastore entity.
    This class is ordering by title.

    Args:
        models (_type_): model class

    Returns:
        _type_: string object (SubjectArea.title)
    """
    title = models.CharField(max_length=25, primary_key=True)
    coordinator = models.ForeignKey(Faculty, on_delete=models.CASCADE)

    def __str__(self) -> str:
        return f'{self.title}'

    class Meta:
        ordering = ['title']
