Last active
August 25, 2020 06:11
-
-
Save velotiotech/573b5c4abec5591835b2335e8422a61f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Author(models.Model): | |
name = models.CharField(max_length=20) | |
class Book(models.Model): | |
name = models.CharField(max_length=20) | |
author = models.ForeignKey("Author", models.CASCADE, related_name="books") | |
created_at = models.DateTimeField(auto_now_add=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment