from django.db import models

class Course(models.Model):
    code = models.CharField(max_length=20, unique=True)
    name = models.CharField(max_length=255)
    credits = models.IntegerField()
    semester = models.IntegerField()
    department = models.CharField(max_length=100)

    def __str__(self):
        return self.name
