Skip to content

Instantly share code, notes, and snippets.

@sankalpjonn
Created June 12, 2021 13:53
Show Gist options
  • Save sankalpjonn/4dba121daf5dff26c8ad28180c400059 to your computer and use it in GitHub Desktop.
Save sankalpjonn/4dba121daf5dff26c8ad28180c400059 to your computer and use it in GitHub Desktop.
from django.db import models
class Country(models.Model):
name = models.CharField(max_length=255)
total_population = models.IntegerField()
class Person(models.Model):
full_name = models.CharField(max_length=255)
first_dose_received_on = models.DateTimeField(null=True, blank=True)
second_dose_received_on = models.DateTimeField(null=True, blank=True)
country = models.ForeignKey(Country, on_delete=models.CASCADE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment