Created
July 20, 2023 05:07
-
-
Save mansha99/e48c39b2bfef0843f608209036e8924c to your computer and use it in GitHub Desktop.
consultant/models.py
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 Consultant(models.Model): | |
name = models.CharField(max_length=255) | |
specialization = models.CharField(max_length=64) | |
def __str__(self): | |
return self.name | |
class Patient(models.Model): | |
name = models.CharField(max_length=255) | |
gender = models.CharField(max_length=16) | |
def __str__(self): | |
return self.name | |
class Appointment(models.Model): | |
consultant = models.ForeignKey(Consultant, on_delete=models.CASCADE) | |
patient = models.ForeignKey(Patient, on_delete=models.CASCADE) | |
date_appointment = models.DateField() | |
comment = models.CharField(max_length=255) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment