Commit 7ae40785 authored by Lance Cedric Tan's avatar Lance Cedric Tan

Updated Homepage/models.py with new fields

parent c620de75
No preview for this file type
No preview for this file type
# Generated by Django 3.2 on 2023-02-16 12:26 # Generated by Django 3.2 on 2023-02-21 04:07
from django.db import migrations, models from django.db import migrations, models
import django.db.models.deletion import django.db.models.deletion
...@@ -17,8 +17,10 @@ class Migration(migrations.Migration): ...@@ -17,8 +17,10 @@ class Migration(migrations.Migration):
fields=[ fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('album_name', models.CharField(max_length=255)), ('album_name', models.CharField(max_length=255)),
('description', models.CharField(max_length=255)), ('description', models.TextField()),
('release_date', models.CharField(max_length=255)), ('release_date', models.DateField()),
('label', models.CharField(max_length=255)),
('song_count', models.IntegerField()),
], ],
), ),
migrations.CreateModel( migrations.CreateModel(
...@@ -27,6 +29,8 @@ class Migration(migrations.Migration): ...@@ -27,6 +29,8 @@ class Migration(migrations.Migration):
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('artist_name', models.CharField(max_length=255)), ('artist_name', models.CharField(max_length=255)),
('monthly_listeners', models.IntegerField()), ('monthly_listeners', models.IntegerField()),
('birth_name', models.CharField(max_length=255)),
('bio', models.CharField(max_length=700)),
], ],
), ),
migrations.CreateModel( migrations.CreateModel(
...@@ -35,6 +39,8 @@ class Migration(migrations.Migration): ...@@ -35,6 +39,8 @@ class Migration(migrations.Migration):
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('song_title', models.CharField(max_length=255)), ('song_title', models.CharField(max_length=255)),
('song_length', models.IntegerField()), ('song_length', models.IntegerField()),
('music_video', models.BooleanField()),
('lyrics', models.TextField()),
('album', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Homepage.album')), ('album', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Homepage.album')),
('artist', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Homepage.artist')), ('artist', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Homepage.artist')),
], ],
......
...@@ -8,6 +8,8 @@ from django.urls import reverse ...@@ -8,6 +8,8 @@ from django.urls import reverse
class Artist(models.Model): class Artist(models.Model):
artist_name = models.CharField(max_length=255) artist_name = models.CharField(max_length=255)
monthly_listeners = models.IntegerField() monthly_listeners = models.IntegerField()
birth_name = models.CharField(max_length=255)
bio = models.CharField(max_length=700)
def __str__(self): def __str__(self):
return self.artist_name return self.artist_name
...@@ -21,8 +23,10 @@ class Album(models.Model): ...@@ -21,8 +23,10 @@ class Album(models.Model):
Artist, Artist,
on_delete=models.CASCADE on_delete=models.CASCADE
) )
description = models.CharField(max_length=255) description = models.TextField()
release_date = models.CharField(max_length=255) release_date = models.DateField()
label = models.CharField(max_length=255)
song_count = models.IntegerField()
def __str__(self): def __str__(self):
return self.album_name return self.album_name
...@@ -41,6 +45,8 @@ class SongInfo(models.Model): ...@@ -41,6 +45,8 @@ class SongInfo(models.Model):
on_delete=models.CASCADE on_delete=models.CASCADE
) )
song_length = models.IntegerField() song_length = models.IntegerField()
music_video = models.BooleanField()
lyrics = models.TextField()
def __str__(self): def __str__(self):
return self.song_title return self.song_title
......
No preview for this file type
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