Formated files to better follow PEP8 guidelines.

parent 03c9c209
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. \
......
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")
......@@ -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')
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)
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)
......@@ -14,6 +16,7 @@ class Album(models.Model):
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)
......
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