Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Lecturer(models.Model):
- first_name = models.CharField(max_length=100,)
- last_name = models.CharField(max_length=100,)
- def __str__(self):
- return f"{self.first_name} {self.last_name}"
- class Subject(models.Model):
- name = models.CharField(max_length=100,)
- code = models.CharField(max_length=10,)
- lecturer = models.ForeignKey("Lecturer", on_delete=models.SET_NULL, null=True)
- def __str__(self):
- return f"{self.name}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement