Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
funkwhale
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Paul Walko
funkwhale
Commits
679adfe1
Verified
Commit
679adfe1
authored
6 years ago
by
Eliot Berriot
Browse files
Options
Downloads
Patches
Plain Diff
See #126: Added uuid field to all music models
parent
87daa817
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
api/funkwhale_api/music/migrations/0024_auto_20180406_1115.py
+54
-0
54 additions, 0 deletions
...funkwhale_api/music/migrations/0024_auto_20180406_1115.py
api/funkwhale_api/music/models.py
+11
-0
11 additions, 0 deletions
api/funkwhale_api/music/models.py
with
65 additions
and
0 deletions
api/funkwhale_api/music/migrations/0024_auto_20180406_1115.py
0 → 100644
+
54
−
0
View file @
679adfe1
# Generated by Django 2.0.3 on 2018-04-06 11:15
from
django.db
import
migrations
,
models
import
uuid
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'
music
'
,
'
0023_auto_20180405_1830
'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'
album
'
,
name
=
'
uuid
'
,
field
=
models
.
UUIDField
(
db_index
=
True
,
default
=
uuid
.
uuid4
,
unique
=
True
),
),
migrations
.
AddField
(
model_name
=
'
artist
'
,
name
=
'
uuid
'
,
field
=
models
.
UUIDField
(
db_index
=
True
,
default
=
uuid
.
uuid4
,
unique
=
True
),
),
migrations
.
AddField
(
model_name
=
'
importbatch
'
,
name
=
'
uuid
'
,
field
=
models
.
UUIDField
(
db_index
=
True
,
default
=
uuid
.
uuid4
,
unique
=
True
),
),
migrations
.
AddField
(
model_name
=
'
importjob
'
,
name
=
'
uuid
'
,
field
=
models
.
UUIDField
(
db_index
=
True
,
default
=
uuid
.
uuid4
,
unique
=
True
),
),
migrations
.
AddField
(
model_name
=
'
lyrics
'
,
name
=
'
uuid
'
,
field
=
models
.
UUIDField
(
db_index
=
True
,
default
=
uuid
.
uuid4
,
unique
=
True
),
),
migrations
.
AddField
(
model_name
=
'
track
'
,
name
=
'
uuid
'
,
field
=
models
.
UUIDField
(
db_index
=
True
,
default
=
uuid
.
uuid4
,
unique
=
True
),
),
migrations
.
AddField
(
model_name
=
'
trackfile
'
,
name
=
'
uuid
'
,
field
=
models
.
UUIDField
(
db_index
=
True
,
default
=
uuid
.
uuid4
,
unique
=
True
),
),
migrations
.
AddField
(
model_name
=
'
work
'
,
name
=
'
uuid
'
,
field
=
models
.
UUIDField
(
db_index
=
True
,
default
=
uuid
.
uuid4
,
unique
=
True
),
),
]
This diff is collapsed.
Click to expand it.
api/funkwhale_api/music/models.py
+
11
−
0
View file @
679adfe1
...
...
@@ -5,6 +5,7 @@ import datetime
import
tempfile
import
shutil
import
markdown
import
uuid
from
django.conf
import
settings
from
django.db
import
models
...
...
@@ -27,6 +28,8 @@ from . import utils
class
APIModelMixin
(
models
.
Model
):
mbid
=
models
.
UUIDField
(
unique
=
True
,
db_index
=
True
,
null
=
True
,
blank
=
True
)
uuid
=
models
.
UUIDField
(
unique
=
True
,
db_index
=
True
,
default
=
uuid
.
uuid4
)
api_includes
=
[]
creation_date
=
models
.
DateTimeField
(
default
=
timezone
.
now
)
import_hooks
=
[]
...
...
@@ -269,6 +272,8 @@ class Work(APIModelMixin):
class
Lyrics
(
models
.
Model
):
uuid
=
models
.
UUIDField
(
unique
=
True
,
db_index
=
True
,
default
=
uuid
.
uuid4
)
work
=
models
.
ForeignKey
(
Work
,
related_name
=
'
lyrics
'
,
...
...
@@ -396,6 +401,8 @@ class Track(APIModelMixin):
class
TrackFile
(
models
.
Model
):
uuid
=
models
.
UUIDField
(
unique
=
True
,
db_index
=
True
,
default
=
uuid
.
uuid4
)
track
=
models
.
ForeignKey
(
Track
,
related_name
=
'
files
'
,
on_delete
=
models
.
CASCADE
)
audio_file
=
models
.
FileField
(
upload_to
=
'
tracks/%Y/%m/%d
'
,
max_length
=
255
)
...
...
@@ -446,6 +453,8 @@ IMPORT_STATUS_CHOICES = (
)
class
ImportBatch
(
models
.
Model
):
uuid
=
models
.
UUIDField
(
unique
=
True
,
db_index
=
True
,
default
=
uuid
.
uuid4
)
IMPORT_BATCH_SOURCES
=
[
(
'
api
'
,
'
api
'
),
(
'
shell
'
,
'
shell
'
),
...
...
@@ -490,6 +499,8 @@ class ImportBatch(models.Model):
class
ImportJob
(
models
.
Model
):
uuid
=
models
.
UUIDField
(
unique
=
True
,
db_index
=
True
,
default
=
uuid
.
uuid4
)
batch
=
models
.
ForeignKey
(
ImportBatch
,
related_name
=
'
jobs
'
,
on_delete
=
models
.
CASCADE
)
track_file
=
models
.
ForeignKey
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment