Created
February 14, 2020 16:07
-
-
Save ntoll/3b6d380c732711347aad5dd357905394 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
from django.db import models | |
class Musician(models.Model): | |
first_name = models.CharField(max_length=50) | |
last_name = models.CharField(max_length=50) | |
instrument = models.CharField(max_length=100) | |
class Album(models.Model): | |
artist = models.ForeignKey(Musician, on_delete=models.CASCADE) | |
name = models.CharField(max_length=100) | |
release_date = models.DateField() | |
num_stars = models.IntegerField() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment