Commit 5f86b74b authored by Nicholo Pardines's avatar Nicholo Pardines

Added sensible default values to all homepage models

parent 3852f9d8
from django.contrib import admin from django.contrib import admin
from .models import Song, Album, Artist from .models import Song, Album, Artist
# Register your models here. # Register your models here.
class SongAdmin(admin.ModelAdmin):
model = Song
admin.site.register(Song, SongAdmin)
\ No newline at end of file
# Generated by Django 4.1.6 on 2023-02-20 06:52
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='TBA', max_length=60),
),
migrations.AddField(
model_name='album',
name='song_count',
field=models.IntegerField(default='TBA'),
),
migrations.AddField(
model_name='artist',
name='bio',
field=models.CharField(default='TBA', max_length=700),
),
migrations.AddField(
model_name='artist',
name='birth_name',
field=models.CharField(default='TBA', max_length=50),
),
migrations.AddField(
model_name='song',
name='lyrics',
field=models.TextField(default='TBA'),
),
migrations.AddField(
model_name='song',
name='music_video',
field=models.BooleanField(default='False'),
),
migrations.AlterField(
model_name='album',
name='release_date',
field=models.DateField(),
),
migrations.AlterField(
model_name='artist',
name='artist_name',
field=models.CharField(default='TBA', max_length=50),
),
migrations.AlterField(
model_name='song',
name='song_title',
field=models.CharField(default='TBA', max_length=50),
),
]
...@@ -17,9 +17,9 @@ from django.db import models ...@@ -17,9 +17,9 @@ from django.db import models
# * album # * album
# * song_length # * song_length
class Artist(models.Model): class Artist(models.Model):
artist_name = models.CharField(max_length=50) artist_name = models.CharField(max_length=50, default="TBA")
birth_name = models.CharField(max_length=50) birth_name = models.CharField(max_length=50, default="TBA")
bio = models.CharField(max_length=700) bio = models.CharField(max_length=700, default="TBA")
monthly_listeners = models.IntegerField() monthly_listeners = models.IntegerField()
class Album(models.Model): class Album(models.Model):
...@@ -27,13 +27,13 @@ class Album(models.Model): ...@@ -27,13 +27,13 @@ class Album(models.Model):
artist = models.ForeignKey(Artist, on_delete=models.CASCADE) artist = models.ForeignKey(Artist, on_delete=models.CASCADE)
description = models.CharField(max_length=50) description = models.CharField(max_length=50)
release_date = models.DateField() release_date = models.DateField()
label = models.CharField(max_length=60) label = models.CharField(max_length=60, default="TBA")
song_count = models.IntegerField() song_count = models.IntegerField(default="TBA")
class Song(models.Model): class Song(models.Model):
song_title = models.CharField(max_length=50) song_title = models.CharField(max_length=50, default="TBA")
artist = models.ForeignKey(Artist, on_delete=models.CASCADE) artist = models.ForeignKey(Artist, on_delete=models.CASCADE)
album = models.ForeignKey(Album, on_delete=models.CASCADE) album = models.ForeignKey(Album, on_delete=models.CASCADE)
song_length = models.IntegerField() song_length = models.IntegerField()
music_video = models.BooleanField() music_video = models.BooleanField(default="False")
lyrics = models.TextField() lyrics = models.TextField(default="TBA")
\ No newline at end of file \ 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