Formated files to better follow PEP8 guidelines.

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