Skip to content

Instantly share code, notes, and snippets.

@mansha99
Created July 20, 2023 05:07
Show Gist options
  • Save mansha99/e48c39b2bfef0843f608209036e8924c to your computer and use it in GitHub Desktop.
Save mansha99/e48c39b2bfef0843f608209036e8924c to your computer and use it in GitHub Desktop.
consultant/models.py
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