No Description

models.py 793B

1234567891011121314151617181920212223242526
  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. semestre = models.IntegerField(default=0)
  17. horario = models.CharField(max_length=50)
  18. dias = models.CharField(max_length=10)
  19. salon = models.CharField(max_length=12)