Commit 86b0e8e0 authored by Star Neptune R. Sy's avatar Star Neptune R. Sy

added the 'about' application

parent e5374036
......@@ -42,6 +42,7 @@ INSTALLED_APPS = [
'django.contrib.messages',
'django.contrib.staticfiles',
'homepage',
'about',
'contact',
]
......
# Generated by Django 3.2 on 2023-02-16 15:35
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='IndexCard',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=100)),
('section', models.CharField(max_length=5)),
('age', models.IntegerField()),
],
),
]
# Generated by Django 3.2 on 2023-02-16 15:45
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('about', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Subject',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=50)),
('teacher_name', models.CharField(max_length=50)),
('units', models.IntegerField()),
],
),
]
# about/models.py
from django.db import models
# Create your models here.
class Artist(models.Model):
artist_name = models.CharField(max_length=50, unique=True)
monthly_listeners = models.IntegerField()
pass
class Album(models.Model):
album_name = models.CharField(max_length=50, unique=True)
artist = models.ForeignKey(
Artist,
on_delete=models.CASCADE,
related_name='song'
)
description = models.CharField(max_length=500, unique=True)
release_date = models.DateField()
pass
class Song(models.Model):
song_title = models.CharField(max_length=50)
artist = models.ForeignKey(
Artist,
on_delete=models.CASCADE,
related_name='song'
)
album = models.ForeignKey(
Album,
on_delete=models.CASCADE,
)
song_length = models.TimeField()
# about/urls.py
from django.urls import path
from .views import index
urlpatterns = [
path('', index, name='index'),
]
# This might be needed, depending on your Django version
app_name = "about"
\ No newline at end of file
from django.shortcuts import render
# contact/views.py
from django.http import HttpResponse
# Create your views here.
def index(request):
return HttpResponse("About my song preferences")
\ 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