Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
steering
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
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
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
AURA
steering
Commits
11ff3ea5
Commit
11ff3ea5
authored
8 years ago
by
Christian Pointner
Browse files
Options
Downloads
Patches
Plain Diff
added support for new noplaying db format
parent
bee4dba4
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
nop/migrations/0001_initial.py
+3
-2
3 additions, 2 deletions
nop/migrations/0001_initial.py
nop/models.py
+13
-2
13 additions, 2 deletions
nop/models.py
with
16 additions
and
4 deletions
nop/migrations/0001_initial.py
+
3
−
2
View file @
11ff3ea5
...
...
@@ -2,6 +2,7 @@
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
import
nop.models
class
Migration
(
migrations
.
Migration
):
...
...
@@ -22,7 +23,7 @@ class Migration(migrations.Migration):
(
'
title
'
,
models
.
CharField
(
max_length
=
765
,
blank
=
True
)),
(
'
artist
'
,
models
.
CharField
(
max_length
=
765
,
blank
=
True
)),
(
'
album
'
,
models
.
CharField
(
max_length
=
765
,
blank
=
True
)),
(
'
ismusic
'
,
models
.
IntegerField
(
null
=
True
,
blank
=
True
)),
(
'
carttype
'
,
nop
.
models
.
CartTypeField
(
max_length
=
64
,
blank
=
True
)),
],
options
=
{
'
ordering
'
:
[
'
-timestamp
'
],
...
...
@@ -39,7 +40,7 @@ class Migration(migrations.Migration):
(
'
title
'
,
models
.
CharField
(
max_length
=
765
,
blank
=
True
)),
(
'
artist
'
,
models
.
CharField
(
max_length
=
765
,
blank
=
True
)),
(
'
album
'
,
models
.
CharField
(
max_length
=
765
,
blank
=
True
)),
(
'
ismusic
'
,
models
.
IntegerField
(
null
=
True
,
blank
=
True
)),
(
'
carttype
'
,
nop
.
models
.
CartTypeField
(
max_length
=
64
,
blank
=
True
)),
],
options
=
{
'
ordering
'
:
[
'
-timestamp
'
],
...
...
This diff is collapsed.
Click to expand it.
nop/models.py
+
13
−
2
View file @
11ff3ea5
from
django.db
import
models
class
CartTypeField
(
models
.
Field
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
self
.
types
=
[(
'
show
'
,
'
Show
'
),
(
'
pool
'
,
'
Musicpool
'
),
(
'
jingle
'
,
'
Jingle
'
),
]
super
(
CartTypeField
,
self
).
__init__
(
*
args
,
**
kwargs
)
def
db_type
(
self
,
connection
):
return
"
ENUM({})
"
.
format
(
'
,
'
.
join
(
"'
{}
'"
.
format
(
col
)
for
col
,
_
in
self
.
types
))
class
Master
(
models
.
Model
):
timestamp
=
models
.
BigIntegerField
(
primary_key
=
True
)
...
...
@@ -9,7 +20,7 @@ class Master(models.Model):
title
=
models
.
CharField
(
max_length
=
765
,
blank
=
True
)
artist
=
models
.
CharField
(
max_length
=
765
,
blank
=
True
)
album
=
models
.
CharField
(
max_length
=
765
,
blank
=
True
)
ismusic
=
models
.
IntegerField
(
null
=
True
,
blank
=
True
)
carttype
=
CartTypeField
(
max_length
=
64
,
blank
=
True
)
class
Meta
:
db_table
=
u
'
master
'
...
...
@@ -24,7 +35,7 @@ class Standby(models.Model):
title
=
models
.
CharField
(
max_length
=
765
,
blank
=
True
)
artist
=
models
.
CharField
(
max_length
=
765
,
blank
=
True
)
album
=
models
.
CharField
(
max_length
=
765
,
blank
=
True
)
ismusic
=
models
.
IntegerField
(
null
=
True
,
blank
=
True
)
carttype
=
CartTypeField
(
max_length
=
64
,
blank
=
True
)
class
Meta
:
db_table
=
u
'
standby
'
...
...
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