Skip to content

Instantly share code, notes, and snippets.

@godd0t
Created July 19, 2022 17:20
Show Gist options
  • Save godd0t/93e8619a44dc72489804a968e45e620c to your computer and use it in GitHub Desktop.
Save godd0t/93e8619a44dc72489804a968e45e620c to your computer and use it in GitHub Desktop.
from django.db import models
class Person(models.Model):
first_name = models.CharField(max_length=100)
last_name = models.CharField(max_length=100)
class Book(models.Model):
name = models.CharField(max_length=100)
author = models.ForeignKey(Person, on_delete=models.CASCADE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment