Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
drewidquival_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
Andrew Justin C. Idquival
drewidquival_music
Commits
4e4596ab
Commit
4e4596ab
authored
Mar 01, 2023
by
Andrew Justin C. Idquival
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added the models in homepage app
parent
bbeb1a21
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
39 additions
and
1 deletion
+39
-1
__init__.cpython-310.pyc
...uival_music/homepage/__pycache__/__init__.cpython-310.pyc
+0
-0
admin.cpython-310.pyc
...idquival_music/homepage/__pycache__/admin.cpython-310.pyc
+0
-0
apps.cpython-310.pyc
drewidquival_music/homepage/__pycache__/apps.cpython-310.pyc
+0
-0
models.cpython-310.pyc
...dquival_music/homepage/__pycache__/models.cpython-310.pyc
+0
-0
urls.cpython-310.pyc
drewidquival_music/homepage/__pycache__/urls.cpython-310.pyc
+0
-0
views.cpython-310.pyc
...idquival_music/homepage/__pycache__/views.cpython-310.pyc
+0
-0
__init__.cpython-310.pyc
.../homepage/migrations/__pycache__/__init__.cpython-310.pyc
+0
-0
models.py
drewidquival_music/homepage/models.py
+39
-1
No files found.
drewidquival_music/homepage/__pycache__/__init__.cpython-310.pyc
0 → 100644
View file @
4e4596ab
File added
drewidquival_music/homepage/__pycache__/admin.cpython-310.pyc
0 → 100644
View file @
4e4596ab
File added
drewidquival_music/homepage/__pycache__/apps.cpython-310.pyc
0 → 100644
View file @
4e4596ab
File added
drewidquival_music/homepage/__pycache__/models.cpython-310.pyc
0 → 100644
View file @
4e4596ab
File added
drewidquival_music/homepage/__pycache__/urls.cpython-310.pyc
0 → 100644
View file @
4e4596ab
File added
drewidquival_music/homepage/__pycache__/views.cpython-310.pyc
0 → 100644
View file @
4e4596ab
File added
drewidquival_music/homepage/migrations/__pycache__/__init__.cpython-310.pyc
0 → 100644
View file @
4e4596ab
File added
drewidquival_music/homepage/models.py
View file @
4e4596ab
from
django.db
import
models
from
django.urls
import
reverse
# Create your models here.
class
Artist
(
models
.
Model
):
artist_name
=
models
.
CharField
(
max_length
=
50
,
unique
=
True
)
monthly_listeners
=
models
.
IntegerField
()
def
__str__
(
self
):
return
'{} | {} monthly listeners'
.
format
(
self
.
artist_name
,
self
.
monthly_listeners
)
def
get_absolute_url
(
self
):
return
reverse
(
'subject_detail'
,
args
=
[
str
(
self
.
artist_name
)])
class
Album
(
models
.
Model
):
album_name
=
models
.
CharField
(
max_length
=
50
,
unique
=
True
)
artist
=
models
.
CharField
(
max_length
=
50
)
description
=
models
.
CharField
(
max_length
=
500
)
release_date
=
models
.
CharField
(
max_length
=
50
)
def
__str__
(
self
):
return
'{} by {} | {} | Released in {}'
.
format
(
self
.
album_name
,
self
.
artist
,
self
.
description
,
self
.
release_date
)
def
get_absolute_url
(
self
):
return
reverse
(
'subject_detail'
,
args
=
[
str
(
self
.
album_name
)])
class
Song
(
models
.
Model
):
song_title
=
models
.
CharField
(
max_length
=
50
,
unique
=
True
)
album
=
models
.
CharField
(
max_length
=
50
)
artist
=
models
.
CharField
(
max_length
=
500
)
song_length
=
models
.
IntegerField
()
def
__str__
(
self
):
return
'{} by {} | {} | Released in {}'
.
format
(
self
.
song_title
,
self
.
artist
,
self
.
album
,
self
.
song_length
)
def
get_absolute_url
(
self
):
return
reverse
(
'subject_detail'
,
args
=
[
str
(
self
.
song_title
)])
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