from django.db import models
class Patient(models.Model):
first_name = models.CharField(max_length=50)
last_name = models.CharField(max_length=50)
age = models.IntegerField()
diagnosis = models.TextField()
admitted_on = models.DateField(auto_now_add=True)
def __str__(self):
return f"{self.first_name} {self.last_name}"
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter