diff --git a/submissions/constants.py b/submissions/constants.py index 2b247ffa6a78a9c83e72934b3871e42c21ec3435..6fa524e42eafdb888dbf6aa8d1c8ff3f847a6149 100644 --- a/submissions/constants.py +++ b/submissions/constants.py @@ -124,6 +124,7 @@ ASSIGNMENT_REFUSAL_REASONS = ( ) REFEREE_QUALIFICATION = ( + (None, '-'), (4, 'expert in this subject'), (3, 'very knowledgeable in this subject'), (2, 'knowledgeable in this subject'), @@ -132,6 +133,7 @@ REFEREE_QUALIFICATION = ( ) QUALITY_SPEC = ( + (None, '-'), (6, 'perfect'), (5, 'excellent'), (4, 'good'), @@ -143,7 +145,7 @@ QUALITY_SPEC = ( # Only values between 0 and 100 are kept, anything outside those limits is discarded. RANKING_CHOICES = ( - (101, '-'), + (None, '-'), (100, 'top'), (80, 'high'), (60, 'good'), @@ -153,6 +155,7 @@ RANKING_CHOICES = ( ) 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'), (2, 'Publish as Tier II (top 50% of papers in this journal)'), (3, 'Publish as Tier III (meets the criteria of this journal)'), diff --git a/submissions/migrations/0050_auto_20170721_1042.py b/submissions/migrations/0050_auto_20170721_1042.py new file mode 100644 index 0000000000000000000000000000000000000000..f81add96676950e1daed51e7c308e02dc48f82d2 --- /dev/null +++ b/submissions/migrations/0050_auto_20170721_1042.py @@ -0,0 +1,68 @@ +# -*- 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), + ] diff --git a/submissions/migrations/0051_auto_20170721_1049.py b/submissions/migrations/0051_auto_20170721_1049.py new file mode 100644 index 0000000000000000000000000000000000000000..5ccf06a410f6f585b3f2ce23faecf963d0a88af6 --- /dev/null +++ b/submissions/migrations/0051_auto_20170721_1049.py @@ -0,0 +1,25 @@ +# -*- 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'), + ), + ] diff --git a/submissions/migrations/0052_auto_20170721_1057.py b/submissions/migrations/0052_auto_20170721_1057.py new file mode 100644 index 0000000000000000000000000000000000000000..c89df6fc0f4aba11de3118a756d79c46e47f29d5 --- /dev/null +++ b/submissions/migrations/0052_auto_20170721_1057.py @@ -0,0 +1,30 @@ +# -*- 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')]), + ), + ] diff --git a/submissions/models.py b/submissions/models.py index ee7b65f05f741be45372fb2538b5b770502892c8..7209ea33ba7b1c6bb4902073aedb2ac69ab13cf7 100644 --- a/submissions/models.py +++ b/submissions/models.py @@ -271,13 +271,13 @@ class Report(models.Model): requested_changes = models.TextField(verbose_name="requested changes", blank=True) # Qualities: - validity = models.PositiveSmallIntegerField(choices=RANKING_CHOICES, default=101, + validity = models.PositiveSmallIntegerField(choices=RANKING_CHOICES, null=True, blank=True) - significance = models.PositiveSmallIntegerField(choices=RANKING_CHOICES, default=101, + significance = models.PositiveSmallIntegerField(choices=RANKING_CHOICES, null=True, blank=True) - originality = models.PositiveSmallIntegerField(choices=RANKING_CHOICES, default=101, + originality = models.PositiveSmallIntegerField(choices=RANKING_CHOICES, null=True, blank=True) - clarity = models.PositiveSmallIntegerField(choices=RANKING_CHOICES, default=101, + clarity = models.PositiveSmallIntegerField(choices=RANKING_CHOICES, null=True, blank=True) formatting = models.SmallIntegerField(choices=QUALITY_SPEC, null=True, blank=True, verbose_name="Quality of paper formatting")