Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
danielramos_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 Riz Daniel Ramos
danielramos_music
Commits
015b04f9
Commit
015b04f9
authored
Feb 16, 2023
by
John Riz Daniel Ramos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Artist, Album, Song to Admin.py
parent
ca9469e8
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
58 additions
and
8 deletions
+58
-8
db.sqlite3
danielramos_music/db.sqlite3
+0
-0
admin.cpython-39.pyc
danielramos_music/homepage/__pycache__/admin.cpython-39.pyc
+0
-0
models.cpython-39.pyc
danielramos_music/homepage/__pycache__/models.cpython-39.pyc
+0
-0
admin.py
danielramos_music/homepage/admin.py
+18
-1
0002_auto_20230216_1611.py
...amos_music/homepage/migrations/0002_auto_20230216_1611.py
+33
-0
0002_auto_20230216_1611.cpython-39.pyc
...ations/__pycache__/0002_auto_20230216_1611.cpython-39.pyc
+0
-0
models.py
danielramos_music/homepage/models.py
+7
-7
No files found.
danielramos_music/db.sqlite3
View file @
015b04f9
No preview for this file type
danielramos_music/homepage/__pycache__/admin.cpython-39.pyc
View file @
015b04f9
No preview for this file type
danielramos_music/homepage/__pycache__/models.cpython-39.pyc
View file @
015b04f9
No preview for this file type
danielramos_music/homepage/admin.py
View file @
015b04f9
from
django.contrib
import
admin
# Register your models here.
from
.models
import
Artist
,
Album
,
Song
class
ArtistAdmin
(
admin
.
ModelAdmin
):
model
=
Artist
list_display
=
(
'artist_name'
,
'monthly_listeners'
)
class
AlbumAdmin
(
admin
.
ModelAdmin
):
model
=
Album
list_display
=
(
'album_name'
,
'artist'
,
'description'
,
'release_date'
)
class
SongAdmin
(
admin
.
ModelAdmin
):
model
=
Song
list_display
=
(
'song_title'
,
'artist'
,
'album'
,
'song_length'
)
admin
.
site
.
register
(
Artist
,
ArtistAdmin
)
admin
.
site
.
register
(
Album
,
AlbumAdmin
)
admin
.
site
.
register
(
Song
,
SongAdmin
)
\ No newline at end of file
danielramos_music/homepage/migrations/0002_auto_20230216_1611.py
0 → 100644
View file @
015b04f9
# Generated by Django 3.2 on 2023-02-16 08:11
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'homepage'
,
'0001_initial'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'album'
,
name
=
'artist'
,
field
=
models
.
CharField
(
max_length
=
50
,
unique
=
True
),
),
migrations
.
AlterField
(
model_name
=
'album'
,
name
=
'description'
,
field
=
models
.
CharField
(
max_length
=
150
,
unique
=
True
),
),
migrations
.
AlterField
(
model_name
=
'artist'
,
name
=
'artist_name'
,
field
=
models
.
CharField
(
max_length
=
50
,
unique
=
True
),
),
migrations
.
AlterField
(
model_name
=
'song'
,
name
=
'artist'
,
field
=
models
.
CharField
(
max_length
=
50
,
unique
=
True
),
),
]
danielramos_music/homepage/migrations/__pycache__/0002_auto_20230216_1611.cpython-39.pyc
0 → 100644
View file @
015b04f9
File added
danielramos_music/homepage/models.py
View file @
015b04f9
...
...
@@ -2,26 +2,26 @@ from django.db import models
# Create your models here.
class
Artist
(
models
.
Model
):
artist_name
=
models
.
CharField
(
max_length
=
50
)
artist_name
=
models
.
CharField
(
max_length
=
50
,
unique
=
True
)
monthly_listeners
=
models
.
IntegerField
()
def
__str__
(
self
):
return
'{}: {} '
.
format
(
self
.
artist_name
,
self
.
monthly_listeners
)
return
'{}: {}
monthly listeners
'
.
format
(
self
.
artist_name
,
self
.
monthly_listeners
)
class
Album
(
models
.
Model
):
album_name
=
models
.
CharField
(
max_length
=
50
)
artist
=
models
.
CharField
(
max_length
=
50
)
description
=
models
.
CharField
(
max_length
=
150
)
artist
=
models
.
CharField
(
max_length
=
50
,
unique
=
True
)
description
=
models
.
CharField
(
max_length
=
150
,
unique
=
True
)
release_date
=
models
.
CharField
(
max_length
=
50
)
def
__str__
(
self
):
return
'{}
: {}
'
.
format
(
self
.
album_name
,
self
.
artist
,
self
.
description
,
self
.
release_date
)
return
'{}
by {} | {} Released on {}
'
.
format
(
self
.
album_name
,
self
.
artist
,
self
.
description
,
self
.
release_date
)
class
Song
(
models
.
Model
):
song_title
=
models
.
CharField
(
max_length
=
50
)
artist
=
models
.
CharField
(
max_length
=
50
)
artist
=
models
.
CharField
(
max_length
=
50
,
unique
=
True
)
album
=
models
.
CharField
(
max_length
=
150
)
song_length
=
models
.
IntegerField
()
def
__str__
(
self
):
return
'{}: {} '
.
format
(
self
.
song_title
,
self
.
artist
,
self
.
album
,
self
.
song_length
)
\ No newline at end of file
return
'{} | {} | {} | {} secs.'
.
format
(
self
.
song_title
,
self
.
artist
,
self
.
album
,
self
.
song_length
)
\ No newline at end of file
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