Created
December 5, 2020 13:12
-
-
Save pedrohsbarbosa99/db297af7da5aa0158917ed55cf895ece to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends 'base.html' %} | |
{% block content %} | |
<div class="container"> | |
<h1 class="mt-5">Agendamentos</h1> | |
<table class="table"> | |
<thead class="thead-dark"> | |
<tr> | |
<th>ID</th> | |
<th>Professor</th> | |
<th>Aluno</th> | |
<th>Data</th> | |
<th>Hora</th> | |
</tr> | |
</thead> | |
<tbody> | |
{% for date in dateclasses %} | |
<tr> | |
<td>{{ date.id }}</td> | |
<td>{{ date.instructor_id}}</td> | |
<td>{{ date.student_id }}</td> | |
<td>{{ date.date }}</td> | |
<td>{{ date.hour }}</td> | |
</tr> | |
{% endfor %} | |
</tbody> | |
</table> | |
</nav> | |
</div> | |
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
class Instructor(models.Model): | |
name = models.CharField(max_length=50, verbose_name='Nome') | |
graduate = models.CharField(max_length=50, verbose_name="Graduação") | |
phone = models.CharField(max_length=15, verbose_name="Telfone") | |
email = models.CharField(max_length=50, verbose_name="e-mail") | |
active = models.BooleanField(default=True) | |
def __str__(self): | |
return self.name | |
class Student(models.Model): | |
cpf = models.CharField(max_length=14) | |
name = models.CharField(max_length=50, verbose_name="Nome") | |
email = models.EmailField(max_length=50, verbose_name="e-mail") | |
phone = models.CharField(max_length=15, verbose_name="Telefone") | |
born_date = models.DateField(max_length=10,verbose_name="Data nascimento") | |
active = models.BooleanField(default=True) | |
def __str__(self): | |
return self.name | |
class DateClass(models.Model): | |
instructor_id = models.ManyToManyField(Instructor, verbose_name='Professor') | |
student_id = models.ManyToManyField(Student, verbose_name='Aluno') | |
date = models.DateField(verbose_name='Data Aula') | |
hour = models.TimeField(verbose_name='Hora Aula') | |
active = models.BooleanField(default=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment