Commit c63295e8 authored by Elaiza Bolislis's avatar Elaiza Bolislis

Created models that consist information about an artist, an album, and a song...

Created models that consist information about an artist, an album, and a song in the homepage of the music library.
parent 75b454a9
from django.db import models
# Create your models here.
class Artist(models.Model):
artist_name = models.CharField()
monthly_listeners = models.IntegerField()
class Album(models.Model):
album_name = models.CharField()
artist = models.ForeignKey(Artist, on_delete=models.CASCADE)
description = models.CharField()
release_date = models.CharField()
class Song(models.Model):
song_title = models.CharField()
artist = models.ForeignKey(Artist, on_delete=models.CASCADE)
album = artist = models.ForeignKey(Album, on_delete=models.CASCADE)
song_length = models.IntegerField()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment