mirror of
https://github.com/lemeow125/InfoTech-Backend.git
synced 2024-11-17 06:29:26 +08:00
18 lines
527 B
Python
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
|