Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
albert_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
Albert Gagalac
albert_music
Commits
292e7c59
Commit
292e7c59
authored
Feb 21, 2023
by
Albert Gagalac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added new fields in models + modified admin.py
parent
c3625f30
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
8 deletions
+33
-8
admin.py
albert_music/about/admin.py
+3
-0
models.py
albert_music/about/models.py
+15
-8
admin.py
albert_music/homepage/admin.py
+15
-0
No files found.
albert_music/about/admin.py
0 → 100644
View file @
292e7c59
from
django.contrib
import
admin
# Register your models here.
albert_music/about/models.py
View file @
292e7c59
...
...
@@ -3,17 +3,24 @@ from django.db import models
# Create your models here.
class
Artist
(
models
.
Model
):
artist_name
=
models
.
CharField
(
max_length
=
100
,
unique
=
True
)
monthly_listeners
=
models
.
IntegerField
()
artist_name
=
models
.
CharField
(
max_length
=
50
,
unique
=
True
)
monthly_listeners
=
models
.
PositiveIntegerField
()
birth_name
=
models
.
CharField
(
max_length
=
100
,
unique
=
True
)
bio
=
models
.
TextField
(
max_length
=
700
)
class
Album
(
models
.
Model
):
artist
=
models
.
CharField
(
max_length
=
100
,
unique
=
True
)
album_name
=
models
.
CharField
(
max_length
=
100
,
unique
=
True
)
class
Album
(
Artist
):
artist
=
models
.
CharField
(
max_length
=
50
,
unique
=
True
)
album_name
=
models
.
CharField
(
max_length
=
50
,
unique
=
True
)
description
=
models
.
TextField
()
release_date
=
models
.
DateField
()
label
=
models
.
CharField
()
song_count
=
models
.
PositiveIntegerField
()
class
Song
(
models
.
Model
):
song_title
=
models
.
CharField
(
max_length
=
10
0
,
unique
=
True
)
class
Song
(
Album
):
song_title
=
models
.
CharField
(
max_length
=
5
0
,
unique
=
True
)
artist
=
models
.
CharField
(
max_length
=
50
)
description
=
models
.
TextField
()
song_length
=
models
.
IntegerField
()
\ No newline at end of file
song_length
=
models
.
PositiveIntegerField
()
music_video
=
models
.
BooleanField
(
default
=
False
)
lyrics
=
models
.
TextField
()
albert_music/homepage/admin.py
View file @
292e7c59
from
django.contrib
import
admin
# Register your models here.
from
about.models
import
Artist
,
Album
,
Song
class
ArtistAdmin
(
admin
.
ModelAdmin
):
model
=
Artist
class
AlbumAdmin
(
admin
.
ModelAdmin
):
model
=
Album
class
SongAdmin
(
admin
.
ModelAdmin
):
model
=
Song
admin
.
site
.
register
(
Artist
,
ArtistAdmin
)
admin
.
site
.
register
(
Album
,
AlbumAdmin
)
admin
.
site
.
register
(
Song
,
SongAdmin
)
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