Commit 459cf729 authored by alexandre's avatar alexandre

Undetermined value for score type + a few trans

parent 40261851
# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2019-01-10 17:39
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('playground', '0024_auto_20190104_1426'),
]
operations = [
migrations.AlterField(
model_name='score',
name='score_type',
field=models.PositiveSmallIntegerField(choices=[(0, 'inconnu'), (1, 'transcription'), (2, 'prescription'), (3, 'traduction')], default=0),
),
migrations.AlterField(
model_name='score',
name='shared_with',
field=models.ManyToManyField(blank=True, to=settings.AUTH_USER_MODEL),
),
]
......@@ -16,6 +16,7 @@ class Score(models.Model):
"""docstring"""
SCORE_TYPE_CHOICES = (
(0, "inconnu"),
(1, "transcription"),
(2, "prescription"),
(3, "traduction")
......@@ -25,7 +26,7 @@ class Score(models.Model):
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
score_type = models.PositiveSmallIntegerField(
default=1, choices=SCORE_TYPE_CHOICES)
default=0, choices=SCORE_TYPE_CHOICES)
score_author = models.TextField(blank=True)
performance_author = models.TextField(blank=True)
presentation = models.TextField(blank=True)
......
......@@ -57,6 +57,8 @@ class ScoreSerializer(TaggitSerializer, serializers.HyperlinkedModelSerializer):
def create(self, validated_data):
validated_data["created_by"] = self.context['request'].user
# created_by = validated_data.pop('created_by')
shared_with = validated_data.pop('shared_with')
instance = Score.objects.create(**validated_data)
return instance
......
;
window.W = window.W || {};
W.lang = W.lang || {};
......@@ -53,7 +53,7 @@ W.lang.en = {
"La notation W": "The W notation",
"Le choix de W": "The W selection",
"Mise": "Set",
"Modifié le": "Modified on",
"Modifiée le": "Modified on",
"OK": "OK",
"Ok": "Ok",
"Partager avec": "Share with",
......@@ -65,7 +65,7 @@ W.lang.en = {
"performeur(s)": "performer(s)",
"Prescription": "Prescription",
"Présentation": "Presentation",
"Publié le": "Published on",
"Créée le": "Created at",
"rechercher": "search",
"Répertoire de partitions": "Score directory",
"rompre le lien": "break link",
......
......@@ -123,7 +123,7 @@ window.W = window.W || {};
duration: '',
genre: '',
tags: '',
score_type: 1,
score_type: 0,
score_author: "",
performance_author: "",
presentation: "",
......
......@@ -32,6 +32,7 @@
<label>
<span class="label-text"><%- t('Type') %>:</span>
<select name="score_type">
<option value="0" <%- (score_type === 0) ? 'selected' : '' %>><%- t('Indéterminé') %></option>
<option value="1" <%- (score_type === 1) ? 'selected' : '' %>><%- t('Transcription') %></option>
<option value="2" <%- (score_type === 2) ? 'selected' : '' %>><%- t('Prescription') %></option>
<option value="3" <%- (score_type === 3) ? 'selected' : '' %>><%- t('Traduction') %></option>
......
......@@ -125,11 +125,6 @@
</dl>
{% endcomment %}
<dl class="score-meta">
<dt class="score-meta__term score-meta__term--inline"><%- t('Publiée?') %></dt>
<dd class="score-meta__def"><%- is_public %></dd>
</dl>
<div id="permissions"></div>
<form></form>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment