SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit d83a328a authored by Jorran de Wit's avatar Jorran de Wit
Browse files

Display all None-value fields as single dash

parent e3a8288e
No related branches found
No related tags found
No related merge requests found
...@@ -124,6 +124,7 @@ ASSIGNMENT_REFUSAL_REASONS = ( ...@@ -124,6 +124,7 @@ ASSIGNMENT_REFUSAL_REASONS = (
) )
REFEREE_QUALIFICATION = ( REFEREE_QUALIFICATION = (
(None, '-'),
(4, 'expert in this subject'), (4, 'expert in this subject'),
(3, 'very knowledgeable in this subject'), (3, 'very knowledgeable in this subject'),
(2, 'knowledgeable in this subject'), (2, 'knowledgeable in this subject'),
...@@ -132,6 +133,7 @@ REFEREE_QUALIFICATION = ( ...@@ -132,6 +133,7 @@ REFEREE_QUALIFICATION = (
) )
QUALITY_SPEC = ( QUALITY_SPEC = (
(None, '-'),
(6, 'perfect'), (6, 'perfect'),
(5, 'excellent'), (5, 'excellent'),
(4, 'good'), (4, 'good'),
...@@ -143,7 +145,7 @@ QUALITY_SPEC = ( ...@@ -143,7 +145,7 @@ QUALITY_SPEC = (
# Only values between 0 and 100 are kept, anything outside those limits is discarded. # Only values between 0 and 100 are kept, anything outside those limits is discarded.
RANKING_CHOICES = ( RANKING_CHOICES = (
(101, '-'), (None, '-'),
(100, 'top'), (100, 'top'),
(80, 'high'), (80, 'high'),
(60, 'good'), (60, 'good'),
...@@ -153,6 +155,7 @@ RANKING_CHOICES = ( ...@@ -153,6 +155,7 @@ RANKING_CHOICES = (
) )
REPORT_REC = ( REPORT_REC = (
(None, '-'),
(1, 'Publish as Tier I (top 10% of papers in this journal, qualifies as Select) NOTE: SELECT NOT YET OPEN, STARTS EARLY 2017'), (1, 'Publish as Tier I (top 10% of papers in this journal, qualifies as Select) NOTE: SELECT NOT YET OPEN, STARTS EARLY 2017'),
(2, 'Publish as Tier II (top 50% of papers in this journal)'), (2, 'Publish as Tier II (top 50% of papers in this journal)'),
(3, 'Publish as Tier III (meets the criteria of this journal)'), (3, 'Publish as Tier III (meets the criteria of this journal)'),
......
# -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2017-07-21 08:42
from __future__ import unicode_literals
from django.db import migrations, models
def report_101_to_none(apps, schema_editor):
Report = apps.get_model('submissions', 'Report')
for rep in Report.objects.all():
if rep.clarity == 101:
rep.clarity = None
if rep.originality == 101:
rep.originality = None
if rep.significance == 101:
rep.significance = None
if rep.validity == 101:
rep.validity = None
rep.save()
print('\nChanged all Report fields: {clarites,originality,significance,validity} with value'
' `101` to `None`.')
def report_none_to_101(apps, schema_editor):
Report = apps.get_model('submissions', 'Report')
for rep in Report.objects.all():
if not rep.clarity:
rep.clarity = 101
if not rep.originality:
rep.originality = 101
if not rep.significance:
rep.significance = 101
if not rep.validity:
rep.validity = 101
rep.save()
print('\nChanged all Report fields: {clarites,originality,significance,validity} with value'
' `None` to `101`.')
class Migration(migrations.Migration):
dependencies = [
('submissions', '0049_auto_20170721_1010'),
]
operations = [
migrations.AlterField(
model_name='report',
name='clarity',
field=models.PositiveSmallIntegerField(blank=True, choices=[(None, '-'), (100, 'top'), (80, 'high'), (60, 'good'), (40, 'ok'), (20, 'low'), (0, 'poor')], null=True),
),
migrations.AlterField(
model_name='report',
name='originality',
field=models.PositiveSmallIntegerField(blank=True, choices=[(None, '-'), (100, 'top'), (80, 'high'), (60, 'good'), (40, 'ok'), (20, 'low'), (0, 'poor')], null=True),
),
migrations.AlterField(
model_name='report',
name='significance',
field=models.PositiveSmallIntegerField(blank=True, choices=[(None, '-'), (100, 'top'), (80, 'high'), (60, 'good'), (40, 'ok'), (20, 'low'), (0, 'poor')], null=True),
),
migrations.AlterField(
model_name='report',
name='validity',
field=models.PositiveSmallIntegerField(blank=True, choices=[(None, '-'), (100, 'top'), (80, 'high'), (60, 'good'), (40, 'ok'), (20, 'low'), (0, 'poor')], null=True),
),
migrations.RunPython(report_101_to_none, report_none_to_101),
]
# -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2017-07-21 08:49
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('submissions', '0050_auto_20170721_1042'),
]
operations = [
migrations.AlterField(
model_name='report',
name='formatting',
field=models.SmallIntegerField(blank=True, choices=[(None, '-'), (6, 'perfect'), (5, 'excellent'), (4, 'good'), (3, 'reasonable'), (2, 'acceptable'), (1, 'below threshold'), (0, 'mediocre')], null=True, verbose_name='Quality of paper formatting'),
),
migrations.AlterField(
model_name='report',
name='grammar',
field=models.SmallIntegerField(blank=True, choices=[(None, '-'), (6, 'perfect'), (5, 'excellent'), (4, 'good'), (3, 'reasonable'), (2, 'acceptable'), (1, 'below threshold'), (0, 'mediocre')], null=True, verbose_name='Quality of English grammar'),
),
]
# -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2017-07-21 08:57
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('submissions', '0051_auto_20170721_1049'),
]
operations = [
migrations.AlterField(
model_name='eicrecommendation',
name='recommendation',
field=models.SmallIntegerField(choices=[(None, '-'), (1, 'Publish as Tier I (top 10% of papers in this journal, qualifies as Select) NOTE: SELECT NOT YET OPEN, STARTS EARLY 2017'), (2, 'Publish as Tier II (top 50% of papers in this journal)'), (3, 'Publish as Tier III (meets the criteria of this journal)'), (-1, 'Ask for minor revision'), (-2, 'Ask for major revision'), (-3, 'Reject')]),
),
migrations.AlterField(
model_name='report',
name='qualification',
field=models.PositiveSmallIntegerField(choices=[(None, '-'), (4, 'expert in this subject'), (3, 'very knowledgeable in this subject'), (2, 'knowledgeable in this subject'), (1, 'generally qualified'), (0, 'not qualified')], verbose_name='Qualification to referee this: I am'),
),
migrations.AlterField(
model_name='report',
name='recommendation',
field=models.SmallIntegerField(choices=[(None, '-'), (1, 'Publish as Tier I (top 10% of papers in this journal, qualifies as Select) NOTE: SELECT NOT YET OPEN, STARTS EARLY 2017'), (2, 'Publish as Tier II (top 50% of papers in this journal)'), (3, 'Publish as Tier III (meets the criteria of this journal)'), (-1, 'Ask for minor revision'), (-2, 'Ask for major revision'), (-3, 'Reject')]),
),
]
...@@ -271,13 +271,13 @@ class Report(models.Model): ...@@ -271,13 +271,13 @@ class Report(models.Model):
requested_changes = models.TextField(verbose_name="requested changes", blank=True) requested_changes = models.TextField(verbose_name="requested changes", blank=True)
# Qualities: # Qualities:
validity = models.PositiveSmallIntegerField(choices=RANKING_CHOICES, default=101, validity = models.PositiveSmallIntegerField(choices=RANKING_CHOICES,
null=True, blank=True) null=True, blank=True)
significance = models.PositiveSmallIntegerField(choices=RANKING_CHOICES, default=101, significance = models.PositiveSmallIntegerField(choices=RANKING_CHOICES,
null=True, blank=True) null=True, blank=True)
originality = models.PositiveSmallIntegerField(choices=RANKING_CHOICES, default=101, originality = models.PositiveSmallIntegerField(choices=RANKING_CHOICES,
null=True, blank=True) null=True, blank=True)
clarity = models.PositiveSmallIntegerField(choices=RANKING_CHOICES, default=101, clarity = models.PositiveSmallIntegerField(choices=RANKING_CHOICES,
null=True, blank=True) null=True, blank=True)
formatting = models.SmallIntegerField(choices=QUALITY_SPEC, null=True, blank=True, formatting = models.SmallIntegerField(choices=QUALITY_SPEC, null=True, blank=True,
verbose_name="Quality of paper formatting") verbose_name="Quality of paper formatting")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment