InfoTech-Backend/infotech/subjects/models.py
2023-03-21 21:22:14 +08:00

18 lines
527 B
Python

from django.db import models
from django.core.validators import MaxValueValidator, MinValueValidator
# Create your models here.
class Subject(models.Model):
name = models.CharField(max_length=40)
enrolled_count = models.IntegerField(
default=0,
validators=[
MaxValueValidator(60),
MinValueValidator(0)
])
max_slots = models.IntegerField(default=60)
year_level = models.CharField(max_length=20)
def __str__(self):
return self.name