No Description

models.py 941B

12345678910111213141516171819202122232425262728293031
  1. from django.db import models
  2. # Create your models here.
  3. # diego, Diego1999$
  4. class Facultad(models.Model):
  5. fname = models.CharField(max_length=150)
  6. class Curso(models.Model):
  7. fac_id = models.ForeignKey(Facultad, on_delete=models.CASCADE)
  8. name = models.CharField(max_length=150)
  9. code = models.CharField(max_length=9)
  10. creditos = models.IntegerField(default=0)
  11. class Matricula(models.Model):
  12. course_id = models.ForeignKey(Curso, on_delete=models.CASCADE)
  13. section = models.CharField(max_length=5)
  14. prof = models.CharField(max_length=150)
  15. grade = models.CharField(max_length=3)
  16. class ProximoSemestre(models.Model):
  17. course_id = models.ForeignKey(Curso, on_delete=models.CASCADE)
  18. section = models.CharField(max_length=5)
  19. prof = models.CharField(max_length=150)
  20. hours = models.CharField(max_length=50)
  21. days = models.CharField(max_length=12)
  22. rooms = models.CharField(max_length=100)