Skip to content

Instantly share code, notes, and snippets.

@daviwesley
Created September 28, 2018 14:39
Show Gist options
  • Save daviwesley/86ddf276db147ba2281a28ba2111436e to your computer and use it in GitHub Desktop.
Save daviwesley/86ddf276db147ba2281a28ba2111436e to your computer and use it in GitHub Desktop.
from django.db import models
# Create your models here.
class Subject(models.Model):
name = models.CharField(max_length=40)
hours = models.IntegerField()
credits = models.IntegerField()
class Student(models.Model):
name = models.CharField(max_length=55)
id_subscription = models.IntegerField(primary_key=True)
subject = models.ManyToManyField(Subject)
class Situation(models.Model):
SITUACAO = (
('REP', 'Reprovado por falta'),
('ATV', 'Ativo'),
)
sit = models.CharField(max_length=30, choices=SITUACAO, default=ATV)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment