patients/models.py
      
from django.db import models
from django.core.validators import validate_email
from django.utils import timezone 
import datetime   



class Patient(models.Model):
    first_name = models.CharField(max_length=30)
    last_name = models.CharField(max_length=40)
    birth_date = models.DateField(null=True, blank=True)
    email = models.EmailField(blank=True)
    telephone = models.CharField(max_length=130, null=True, blank=True)
    address = models.CharField(max_length=50)
    city = models.CharField(max_length=30,default='Orlando')
    state = models.CharField(max_length=2,default='Fl')
    created = models.DateField(auto_now_add=True, db_index=True)
    # patient_photo = models.ImageField(upload_to='images/patient_photo/%Y/%m/%d/')

    def __str__(self):
        return self.first_name


class Symptom(models.Model):
    patient = models.ForeignKey(Patient, on_delete=models.CASCADE)
    created_at = models.DateTimeField(auto_now_add=True)
    symptom_notes = models.TextField(null=True, blank=True)
    upload = models.FileField(upload_to='Sx_notes_folder/%Y/%m/%d/', null=True, blank=True)

    def __str__(self):
        return self.symptom_notes
    
      
    
  1.  Copied

  2.  Copied

  3.  Copied

  4.  Copied
patients/models.py
      
from django.contrib import admin

from .models import Patient, Symptom

admin.site.register(Patient)
admin.site.register(Symptom)