Commit 2d674e1c authored by Almira Redoble's avatar Almira Redoble

Modified models and migrated them

parent 26873381
# Generated by Django 3.2 on 2023-02-20 09:37
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('homepage', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='album',
name='label',
field=models.CharField(default='', max_length=50),
),
migrations.AddField(
model_name='album',
name='song_count',
field=models.IntegerField(default=1),
),
migrations.AddField(
model_name='artist',
name='bio',
field=models.CharField(default='', max_length=700),
),
migrations.AddField(
model_name='artist',
name='birth_name',
field=models.CharField(default='', max_length=50),
),
migrations.AddField(
model_name='song',
name='lyrics',
field=models.CharField(default='', max_length=300),
),
migrations.AddField(
model_name='song',
name='music_video',
field=models.BooleanField(default=False),
),
]
......@@ -3,6 +3,8 @@ from django.db import models
class Artist(models.Model):
artist_name = models.CharField(max_length=50)
monthly_listeners = models.IntegerField()
birth_name = models.CharField(max_length=50, default="")
bio = models.CharField(max_length=700, default="")
def __str__(self):
return '{}: {} monthly listener(s)'.format(
......@@ -20,6 +22,8 @@ class Album(models.Model):
)
description = models.CharField(max_length=100)
release_date = models.DateField()
label = models.CharField(max_length=50, default="")
song_count = models.IntegerField(default=1)
def __str__(self):
return '{} by {}: \n {} \n released on {}'.format(
......@@ -43,6 +47,8 @@ class Song(models.Model):
related_name='song'
)
song_length = models.IntegerField()
music_video = models.BooleanField(default=False)
lyrics = models.CharField(max_length=300, default="")
def __str__(self):
return '{} by {} in {}'.format(
......@@ -52,5 +58,5 @@ class Song(models.Model):
)
# DateField source: https://www.geeksforgeeks.org/datefield-django-models/
# BooleanField source: https://www.geeksforgeeks.org/booleanfield-django-models/
# Create your models here.
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