Commit f5ff6241 authored by Deokhyun Lee's avatar Deokhyun Lee

some changed on url, models

parent bafa5781
File added
...@@ -21,7 +21,7 @@ from django.urls import include, path ...@@ -21,7 +21,7 @@ from django.urls import include, path
# localhost:<port>/hompage # localhost:<port>/hompage
# localhost:<port>/about # localhost:<port>/about
# localhost:<port>/contact # localhost:<port>/contact
# fo
urlpatterns = [ urlpatterns = [
path('admin/', admin.site.urls), path('admin/', admin.site.urls),
path('homepage/', include('homepage.urls')), path('homepage/', include('homepage.urls')),
......
Deokhyun Lee, 195736, BS CS, C Deokhyun Lee, 195736, BS CS, C
Lab 01 - Song Library Lab 02 - Song Library v2
Feb 13, 2023. Feb 21, 2023.
This lab work is done by me. This lab work is done by me.
-by Deokhyun Lee, Feb 13, 2023. -by Deokhyun Lee, Feb 21, 2023.
\ No newline at end of file \ No newline at end of file
No preview for this file type
# Generated by Django 3.2 on 2023-02-13 08:53
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('homepage', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='song',
name='artist',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='homepage.artist'),
),
]
...@@ -4,6 +4,7 @@ from django.db import models ...@@ -4,6 +4,7 @@ from django.db import models
class Artist(models.Model): class Artist(models.Model):
artist_name = models.CharField(max_length = 50) artist_name = models.CharField(max_length = 50)
monthly_listeners = models.IntegerField() monthly_listeners = models.IntegerField()
birth_name = models.CharField(max_length=700)
# for albums # for albums
class Album(models.Model): class Album(models.Model):
...@@ -11,10 +12,11 @@ class Album(models.Model): ...@@ -11,10 +12,11 @@ class Album(models.Model):
artist = models.CharField(max_length = 50) artist = models.CharField(max_length = 50)
description = models.CharField(max_length = 150) description = models.CharField(max_length = 150)
release_date = models.DateTimeField("date published") release_date = models.DateTimeField("date published")
# for songs # for songs
class Song(models.Model): class Song(models.Model):
song_title = models.CharField(max_length = 100) song_title = models.CharField(max_length = 100)
artist = models.CharField(max_length = 50) 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()
\ 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