Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
work.w
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
30
Issues
30
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
osp
work.w
Commits
11ab2592
Commit
11ab2592
authored
Apr 12, 2018
by
alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Proper tag support (comma separated values).
Update requirements and migrate
parent
35462696
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
5 deletions
+39
-5
organon/settings.py
organon/settings.py
+3
-0
playground/models.py
playground/models.py
+2
-0
playground/serializers.py
playground/serializers.py
+6
-2
playground/static/playground/js/views.js
playground/static/playground/js/views.js
+24
-1
playground/templates/playground/underscore/score-vue.mtpl
playground/templates/playground/underscore/score-vue.mtpl
+2
-2
requirements/base.txt
requirements/base.txt
+2
-0
No files found.
organon/settings.py
View file @
11ab2592
...
...
@@ -26,6 +26,9 @@ INSTALLED_APPS = [
'django.contrib.messages'
,
'django.contrib.staticfiles'
,
'taggit'
,
'taggit_serializer'
,
'rest_framework'
,
'rest_framework.authtoken'
,
'rest_auth'
,
...
...
playground/models.py
View file @
11ab2592
from
django.db
import
models
from
django.contrib.postgres.fields
import
JSONField
from
taggit.managers
import
TaggableManager
class
Attachment
(
models
.
Model
):
...
...
@@ -29,6 +30,7 @@ class Score(models.Model):
duration
=
models
.
TextField
(
blank
=
True
)
genre
=
models
.
TextField
(
blank
=
True
)
tags
=
models
.
TextField
(
blank
=
True
)
tags
=
TaggableManager
()
mainline
=
JSONField
(
blank
=
True
)
language
=
models
.
TextField
(
blank
=
True
)
...
...
playground/serializers.py
View file @
11ab2592
from
.models
import
Attachment
,
Score
from
rest_framework
import
serializers
from
rest_framework_recursive.fields
import
RecursiveField
from
taggit_serializer.serializers
import
(
TagListSerializerField
,
TaggitSerializer
)
class
AttachmentSerializer
(
serializers
.
HyperlinkedModelSerializer
):
...
...
@@ -12,8 +14,9 @@ class AttachmentSerializer(serializers.HyperlinkedModelSerializer):
# read_only_fields = ('attachment',)
class
ScoreSerializer
(
serializers
.
HyperlinkedModelSerializer
):
class
ScoreSerializer
(
TaggitSerializer
,
serializers
.
HyperlinkedModelSerializer
):
id
=
serializers
.
ReadOnlyField
()
tags
=
TagListSerializerField
()
class
Meta
:
model
=
Score
...
...
@@ -25,7 +28,8 @@ class ScoreLightSerializer(serializers.HyperlinkedModelSerializer):
representation.
"""
id
=
serializers
.
ReadOnlyField
()
tags
=
TagListSerializerField
()
class
Meta
:
model
=
Score
fields
=
(
'id'
,
'title'
,
'created_at'
,
'updated_at'
)
fields
=
(
'id'
,
'title'
,
'
tags'
,
'
created_at'
,
'updated_at'
)
playground/static/playground/js/views.js
View file @
11ab2592
...
...
@@ -50,6 +50,11 @@ window.W = window.W || {};
label
:
"
Mise à jour le
"
,
cell
:
MyDatetimeCell
},
{
name
:
"
tags
"
,
label
:
"
Tags
"
,
cell
:
"
string
"
,
},
{
name
:
"
score_type
"
,
label
:
"
Type
"
,
...
...
@@ -1043,7 +1048,7 @@ window.W = window.W || {};
effectif
:
this
.
getChildView
(
'
effectif
'
).
value
(),
stage_set
:
this
.
fieldVal
(
'
stage_set
'
),
duration
:
this
.
fieldVal
(
'
duration
'
),
tags
:
this
.
fieldVal
(
'
tags
'
),
tags
:
this
.
fieldVal
(
'
tags
'
)
.
trim
().
split
(
/
\s
*,
\s
*/
)
,
language
:
this
.
fieldVal
(
'
language
'
)
};
...
...
@@ -1421,6 +1426,24 @@ window.W = window.W || {};
});
var
myPaginationView
=
new
Backgrid
.
Extension
.
Paginator
({
controls
:
{
rewind
:
{
label
:
"
《
"
,
title
:
"
First
"
},
back
:
{
label
:
"
〈
"
,
title
:
"
Previous
"
},
forward
:
{
label
:
"
〉
"
,
title
:
"
Next
"
},
fastForward
:
{
label
:
"
》
"
,
title
:
"
Last
"
}
},
// If you anticipate a large number of pages, you can adjust
// the number of page handles to show. The sliding window
...
...
playground/templates/playground/underscore/score-vue.mtpl
View file @
11ab2592
...
...
@@ -71,7 +71,7 @@
<dd class="extended">
<ul>
<%
tag_list = tags
.split(';')
;
tag_list = tags;
for (var i=0; i < tag_list.length; i++) { %>
<li><%- tag_list[i] %></li>
...
...
@@ -105,4 +105,4 @@
<div id="axis-wrapper">
<ol></ol>
</div>
</div>
\ No newline at end of file
</div>
requirements/base.txt
View file @
11ab2592
...
...
@@ -5,3 +5,5 @@ django-rest-auth
psycopg2
django-filter
django-compressor
django-taggit
django-taggit-serializer
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