Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
javing_music
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
John Aidan Vincent M. Ng
javing_music
Commits
f549eb64
Commit
f549eb64
authored
Feb 20, 2023
by
Javi Ng
Browse files
Options
Browse Files
Download
Plain Diff
about to merge
parents
56f3a243
63f2825e
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
112 additions
and
5 deletions
+112
-5
README.txt
README.txt
+3
-3
.DS_Store
javing_music/.DS_Store
+0
-0
db.sqlite3
javing_music/db.sqlite3
+0
-0
admin.cpython-310.pyc
javing_music/homepage/__pycache__/admin.cpython-310.pyc
+0
-0
models.cpython-310.pyc
javing_music/homepage/__pycache__/models.cpython-310.pyc
+0
-0
admin.py
javing_music/homepage/admin.py
+43
-0
0002_auto_20230220_0547.py
javing_music/homepage/migrations/0002_auto_20230220_0547.py
+43
-0
0002_auto_20230220_0547.cpython-310.pyc
...tions/__pycache__/0002_auto_20230220_0547.cpython-310.pyc
+0
-0
models.py
javing_music/homepage/models.py
+16
-1
javing_music.env
javing_music/javing_music.env
+1
-0
settings.cpython-310.pyc
...g_music/javing_music/__pycache__/settings.cpython-310.pyc
+0
-0
settings.py
javing_music/javing_music/settings.py
+6
-1
No files found.
README.txt
View file @
f549eb64
John Aidan Vincent Ng
214221
CSCI40-C
Lab 0
1: Song Library
February
13
, 2023
Lab 0
2: Song Library v2
February
20
, 2023
I am Javi Ng and this lab was completed by me truthfully.
<sgd> John Aidan Vincent Martinez Ng, 02/13/2023
\ No newline at end of file
<sgd> John Aidan Vincent Martinez Ng, 02/20/2023
\ No newline at end of file
javing_music/.DS_Store
deleted
100644 → 0
View file @
56f3a243
File deleted
javing_music/db.sqlite3
View file @
f549eb64
No preview for this file type
javing_music/homepage/__pycache__/admin.cpython-310.pyc
View file @
f549eb64
No preview for this file type
javing_music/homepage/__pycache__/models.cpython-310.pyc
View file @
f549eb64
No preview for this file type
javing_music/homepage/admin.py
View file @
f549eb64
from
django.contrib
import
admin
from
.models
import
Artist
,
Album
,
Song
# Register your models here.
# Admin page for Artist model
class
ArtistAdmin
(
admin
.
ModelAdmin
):
model
=
Artist
# list artist name, birth name, monthly listeners
list_display
=
(
"artist_name"
,
"birth_name"
,
"monthly_listeners"
)
# search and filter by artist name, birth name
search_fields
=
(
"artist_name"
,
"birth_name"
)
list_filter
=
(
"artist_name"
,
"birth_name"
)
# Admin page for Album model
class
AlbumAdmin
(
admin
.
ModelAdmin
):
model
=
Album
# list artist name, birth name, monthly listeners
list_display
=
(
"album_name"
,
"description"
,
"release_date"
,
"label"
,
"song_count"
)
# search by album name, description or label
search_fields
=
(
"album_name"
,
"description"
,
"label"
)
# filter by album name
list_filter
=
(
"album_name"
,)
# Admin page for Artist model
class
SongAdmin
(
admin
.
ModelAdmin
):
model
=
Song
# list song title, song length, lyrics, whether or not it has music video
list_display
=
(
"song_title"
,
"song_length"
,
"lyrics"
,
"music_video"
)
# search by song title, lyrics
search_fields
=
(
"song_title"
,
"lyrics"
)
# filter by song title
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
javing_music/homepage/migrations/0002_auto_20230220_0547.py
0 → 100644
View file @
f549eb64
# Generated by Django 3.2 on 2023-02-20 05:47
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'homepage'
,
'0001_initial'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'album'
,
name
=
'label'
,
field
=
models
.
CharField
(
default
=
''
,
max_length
=
100
),
),
migrations
.
AddField
(
model_name
=
'album'
,
name
=
'song_count'
,
field
=
models
.
CharField
(
default
=
0
,
max_length
=
50
),
),
migrations
.
AddField
(
model_name
=
'artist'
,
name
=
'bio'
,
field
=
models
.
CharField
(
default
=
''
,
max_length
=
700
),
),
migrations
.
AddField
(
model_name
=
'artist'
,
name
=
'birth_name'
,
field
=
models
.
CharField
(
default
=
''
,
max_length
=
100
),
),
migrations
.
AddField
(
model_name
=
'song'
,
name
=
'lyrics'
,
field
=
models
.
CharField
(
default
=
''
,
max_length
=
1000
),
),
migrations
.
AddField
(
model_name
=
'song'
,
name
=
'music_video'
,
field
=
models
.
BooleanField
(
default
=
False
),
),
]
javing_music/homepage/migrations/__pycache__/0002_auto_20230220_0547.cpython-310.pyc
0 → 100644
View file @
f549eb64
File added
javing_music/homepage/models.py
View file @
f549eb64
...
...
@@ -4,15 +4,30 @@ from django.db import models
class
Artist
(
models
.
Model
):
artist_name
=
models
.
CharField
(
max_length
=
50
)
monthly_listeners
=
models
.
IntegerField
(
default
=
0
)
birth_name
=
models
.
CharField
(
max_length
=
100
,
default
=
""
)
bio
=
models
.
CharField
(
max_length
=
700
,
default
=
""
)
def
__str__
(
self
):
return
self
.
artist_name
class
Album
(
models
.
Model
):
album_name
=
models
.
CharField
(
max_length
=
100
)
artist
=
models
.
ForeignKey
(
Artist
,
on_delete
=
models
.
CASCADE
)
description
=
models
.
CharField
(
max_length
=
500
)
label
=
models
.
CharField
(
max_length
=
100
,
default
=
""
)
song_count
=
models
.
CharField
(
max_length
=
50
,
default
=
0
)
release_date
=
models
.
DateTimeField
(
"Date Released"
)
def
__str__
(
self
):
return
self
.
album_name
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
(
default
=
0
)
\ No newline at end of file
lyrics
=
models
.
CharField
(
max_length
=
1000
,
default
=
""
)
song_length
=
models
.
IntegerField
(
default
=
0
)
music_video
=
models
.
BooleanField
(
default
=
False
)
def
__str__
(
self
):
return
self
.
song_title
javing_music/javing_music.env
0 → 100644
View file @
f549eb64
SECRET_KEY = "django-insecure--s*^ukg&imwq7bq%$ea4w4!#v&11@5@y*4njh(nr($17(oml8!"
\ No newline at end of file
javing_music/javing_music/__pycache__/settings.cpython-310.pyc
View file @
f549eb64
No preview for this file type
javing_music/javing_music/settings.py
View file @
f549eb64
...
...
@@ -11,6 +11,11 @@ https://docs.djangoproject.com/en/3.2/ref/settings/
"""
from
pathlib
import
Path
from
dotenv
import
load_dotenv
import
os
# loading env file
load_dotenv
()
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR
=
Path
(
__file__
)
.
resolve
()
.
parent
.
parent
...
...
@@ -20,7 +25,7 @@ BASE_DIR = Path(__file__).resolve().parent.parent
# See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY
=
'django-insecure--s*^ukg&imwq7bq
%
$ea4w4!#v&11@5@y*4njh(nr($17(oml8!'
SECRET_KEY
=
"django-insecure--s*^ukg&imwq7bq
%
$ea4w4!#v&11@5@y*4njh(nr($17(oml8!"
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG
=
True
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment