Commit 804bda34 authored by Stefan Gomez's avatar Stefan Gomez

Updated the model.py of the Homepage and all of the views.py of each app and migrated them.

parent 5b8aef4b
Pipeline #2815 failed with stages
from django.shortcuts import render from django.shortcuts import render
from django.http import HttpResponse
# Create your views here.
def index(request):
return HttpResponse("I am Stefan Gomez, currently a sophomore at the Ateneo De Manila University, studying BS-CSDGDD. Throughout my life I found myself to have enjoyed listening to EDM music, especially those of the melodic tune. However I do enjoy a little pinch of k-pop into the mix. Lately, I have found myself listening to childhood classics from Disney as I grow older each day. Hearing these songs I adored as a child as I grow older brings so much nostalgia.")
from django.shortcuts import render from django.shortcuts import render
from django.http import HttpResponse
# Create your views here.
def index(request):
return HttpResponse("You can catch me at twitch.tv/Woomy")
# Generated by Django 4.1.7 on 2023-02-21 08:22
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Album',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('album_name', models.CharField(max_length=100)),
('description', models.TextField()),
('release_date', models.CharField(max_length=100)),
],
),
migrations.CreateModel(
name='Artist',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('artist_name', models.CharField(max_length=100)),
('monthly_listeners', models.IntegerField()),
],
),
migrations.CreateModel(
name='Song',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('song_title', models.CharField(max_length=100)),
('song_length', models.IntegerField()),
('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')),
],
),
migrations.AddField(
model_name='album',
name='artist',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Homepage.artist'),
),
]
from django.db import models from django.db import models
# Create your models here. class Artist(models.Model):
artist_name = models.CharField(max_length=100)
monthly_listeners = models.IntegerField()
class Album(models.Model):
album_name = models.CharField(max_length=100)
artist = models.ForeignKey(
Artist,
on_delete=models.CASCADE
)
description = models.TextField()
release_date = models.CharField(max_length=100)
class Song(models.Model):
song_title = models.CharField(max_length=100)
artist = models.ForeignKey(
Artist,
on_delete=models.CASCADE
)
album = models.ForeignKey(
Album,
on_delete=models.CASCADE
)
song_length = models.IntegerField()
from django.shortcuts import render from django.shortcuts import render
from django.http import HttpResponse
# Create your views here.
def index(request):
return HttpResponse("Welcome to Stefan's Music Library!")
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