Formated files to better follow PEP8 guidelines.

parent 03c9c209
......@@ -5,4 +5,4 @@ urlpatterns = [
path('', index, name='index'),
]
app_name = "about"
\ No newline at end of file
app_name = "about"
from django.shortcuts import render
from django.http import HttpResponse
def index(request):
return HttpResponse("Hi! I'm Lance, a second-year student in Ateneo de Manila \
University. I really enjoy playing video games and running. \
......@@ -9,4 +10,4 @@ def index(request):
inclined towards one genre. Previously, I was into J-Pop, \
before that, classical music, and before that, jazz music. \
Currently, I can't stop listening to rap. It's incredibly \
fun to discover new genres and styles of music!")
\ No newline at end of file
fun to discover new genres and styles of music!")
......@@ -5,4 +5,4 @@ urlpatterns = [
path('', index, name='index'),
]
app_name = "contact"
\ No newline at end of file
app_name = "contact"
from django.shortcuts import render
from django.http import HttpResponse
def index(request):
return HttpResponse("You may contact me through the email lance@santuyo\
.com or the phone number 0912-345-6789")
\ No newline at end of file
.com or the phone number 0912-345-6789")
......@@ -6,24 +6,28 @@ from django.contrib import admin
from .models import Artist, Album, Song
class ArtistAdmin(admin.ModelAdmin):
model = Artist
search_fields = ('artist_name', 'birth_name')
list_display = ('artist_name', 'birth_name', 'monthly_listeners')
list_filter = ('artist_name', 'birth_name')
model = Artist
search_fields = ('artist_name', 'birth_name')
list_display = ('artist_name', 'birth_name', 'monthly_listeners')
list_filter = ('artist_name', 'birth_name')
class AlbumAdmin(admin.ModelAdmin):
model = Album
search_fields = ('album_name', 'description', 'label')
list_display = ('album_name', 'description', 'release_date', 'label', 'song_count')
list_filter = ('album_name',)
class SongAdmin(admin.ModelAdmin):
model = Song
search_fields = ('song_title', 'lyrics')
list_display = ('song_title', 'song_length', 'lyrics', 'music_video')
list_filter = ('song_title',)
admin.site.register(Artist, ArtistAdmin)
admin.site.register(Album, AlbumAdmin)
admin.site.register(Song, SongAdmin)
\ No newline at end of file
admin.site.register(Song, SongAdmin)
from django.db import models
class Artist(models.Model):
artist_name = models.CharField(max_length=100)
monthly_listeners = models.IntegerField()
birth_name = models.CharField(max_length=100)
bio = models.CharField(max_length=700)
class Album(models.Model):
album_name = models.CharField(max_length=100)
artist = models.ForeignKey(Artist, on_delete=models.CASCADE)
......@@ -13,11 +15,12 @@ class Album(models.Model):
release_date = models.DateTimeField()
label = models.CharField(max_length=100)
song_count = models.IntegerField()
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()
music_video = models.BooleanField()
lyrics = models.TextField()
\ No newline at end of file
lyrics = models.TextField()
......@@ -5,4 +5,4 @@ urlpatterns = [
path('', index, name='index'),
]
app_name = "homepage"
\ No newline at end of file
app_name = "homepage"
from django.shortcuts import render
from django.http import HttpResponse
def index(request):
return HttpResponse("Welcome to Lance'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