Commit 63d01e7d authored by Elaiza Bolislis's avatar Elaiza Bolislis

Fixed errors in models.py in homepage regarding the maxlength in CharField.

parent c63295e8
...@@ -2,20 +2,25 @@ from django.db import models ...@@ -2,20 +2,25 @@ from django.db import models
class Artist(models.Model): class Artist(models.Model):
artist_name = models.CharField() artist_name = models.CharField(max_length=200)
monthly_listeners = models.IntegerField() monthly_listeners = models.IntegerField()
class Album(models.Model): class Album(models.Model):
album_name = models.CharField() album_name = models.CharField(max_length=200)
artist = models.ForeignKey(Artist, on_delete=models.CASCADE) artist = models.ForeignKey(Artist,
description = models.CharField() on_delete=models.CASCADE,
release_date = models.CharField() related_name='album'
)
description = models.CharField(max_length=200)
release_date = models.DateField()
class Song(models.Model): class Song(models.Model):
song_title = models.CharField() song_title = models.CharField(max_length=200)
artist = models.ForeignKey(Artist, on_delete=models.CASCADE) artist = models.ForeignKey(Artist,
on_delete=models.CASCADE,
related_name='song'
)
album = artist = models.ForeignKey(Album, on_delete=models.CASCADE) album = artist = models.ForeignKey(Album, on_delete=models.CASCADE)
song_length = models.IntegerField() song_length = models.IntegerField()
\ No newline at end of file
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