Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
ianaragoza_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
Ian Rafael T. Aragoza
ianaragoza_music
Commits
3279d3bf
Commit
3279d3bf
authored
Feb 20, 2023
by
Ian Rafael T. Aragoza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated and migrated models.
parent
6a0b3d47
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
50 additions
and
7 deletions
+50
-7
db.sqlite3
ianaragoza_music/db.sqlite3
+0
-0
models.cpython-311.pyc
ianaragoza_music/homepage/__pycache__/models.cpython-311.pyc
+0
-0
0004_album_label_album_song_count_artist_bio_and_more.py
.../0004_album_label_album_song_count_artist_bio_and_more.py
+43
-0
0004_album_label_album_song_count_artist_bio_and_more.cpython-311.pyc
...abel_album_song_count_artist_bio_and_more.cpython-311.pyc
+0
-0
models.py
ianaragoza_music/homepage/models.py
+7
-7
No files found.
ianaragoza_music/db.sqlite3
View file @
3279d3bf
No preview for this file type
ianaragoza_music/homepage/__pycache__/models.cpython-311.pyc
View file @
3279d3bf
No preview for this file type
ianaragoza_music/homepage/migrations/0004_album_label_album_song_count_artist_bio_and_more.py
0 → 100644
View file @
3279d3bf
# Generated by Django 4.1.6 on 2023-02-20 11:33
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'homepage'
,
'0003_alter_artist_monthly_listeners'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'album'
,
name
=
'label'
,
field
=
models
.
CharField
(
blank
=
True
,
max_length
=
100
),
),
migrations
.
AddField
(
model_name
=
'album'
,
name
=
'song_count'
,
field
=
models
.
IntegerField
(
blank
=
True
,
null
=
True
),
),
migrations
.
AddField
(
model_name
=
'artist'
,
name
=
'bio'
,
field
=
models
.
TextField
(
blank
=
True
,
null
=
True
),
),
migrations
.
AddField
(
model_name
=
'artist'
,
name
=
'birth_name'
,
field
=
models
.
CharField
(
blank
=
True
,
max_length
=
100
,
null
=
True
),
),
migrations
.
AddField
(
model_name
=
'song'
,
name
=
'lyrics'
,
field
=
models
.
TextField
(
blank
=
True
,
null
=
True
),
),
migrations
.
AddField
(
model_name
=
'song'
,
name
=
'music_video'
,
field
=
models
.
BooleanField
(
default
=
False
),
),
]
ianaragoza_music/homepage/migrations/__pycache__/0004_album_label_album_song_count_artist_bio_and_more.cpython-311.pyc
0 → 100644
View file @
3279d3bf
File added
ianaragoza_music/homepage/models.py
View file @
3279d3bf
...
...
@@ -7,9 +7,9 @@ from django.urls import reverse
class
Artist
(
models
.
Model
):
artist_name
=
models
.
CharField
(
max_length
=
100
,
unique
=
True
)
birth_name
=
models
.
CharField
(
max_length
=
100
)
birth_name
=
models
.
CharField
(
max_length
=
100
,
blank
=
True
,
null
=
True
)
monthly_listeners
=
models
.
IntegerField
()
bio
=
models
.
CharField
(
max_length
=
700
)
bio
=
models
.
TextField
(
blank
=
True
,
null
=
True
)
def
__str__
(
self
):
return
'{}'
.
format
(
self
.
artist_name
,
self
.
monthly_listeners
)
...
...
@@ -22,8 +22,8 @@ class Album(models.Model):
artist
=
models
.
ForeignKey
(
Artist
,
on_delete
=
models
.
CASCADE
,
related_name
=
'albums'
)
description
=
models
.
CharField
(
max_length
=
255
)
release_date
=
models
.
DateField
()
label
=
models
.
CharField
(
max_length
=
100
)
song_count
=
models
.
IntegerField
(
)
song_count
=
models
.
IntegerField
(
blank
=
True
,
null
=
True
)
label
=
models
.
CharField
(
max_length
=
100
,
blank
=
True
)
def
__str__
(
self
):
return
'{} by {}'
.
format
(
self
.
album_name
,
self
.
artist
)
...
...
@@ -36,11 +36,11 @@ class Song(models.Model):
artist
=
models
.
ForeignKey
(
Artist
,
on_delete
=
models
.
CASCADE
,
related_name
=
'songs'
)
album
=
models
.
ForeignKey
(
Album
,
on_delete
=
models
.
CASCADE
,
related_name
=
'songs'
)
song_length
=
models
.
DurationField
()
music_video
=
models
.
BooleanField
()
lyrics
=
models
.
CharField
(
)
music_video
=
models
.
BooleanField
(
default
=
False
)
lyrics
=
models
.
TextField
(
blank
=
True
,
null
=
True
)
def
__str__
(
self
):
return
'{} - {}
({})'
.
format
(
self
.
artist
,
self
.
song_title
,
self
.
song_length
)
return
'{} - {}
'
.
format
(
self
.
artist
,
self
.
song_title
)
def
get_absolute_url
(
self
):
return
reverse
(
'song_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