diff --git a/app/api/models.py b/app/api/models.py index bdb18c16..119a4697 100644 --- a/app/api/models.py +++ b/app/api/models.py @@ -6,7 +6,6 @@ from django.db.models.signals import post_save, pre_delete from django.urls import reverse from django.conf import settings from django.contrib.auth.models import User -from django.contrib.staticfiles.storage import staticfiles_storage from django.core.exceptions import ValidationError from polymorphic.models import PolymorphicModel @@ -39,10 +38,6 @@ class Project(PolymorphicModel): def get_absolute_url(self): return reverse('upload', args=[self.id]) - @property - def image(self): - raise NotImplementedError() - def get_bundle_name(self): raise NotImplementedError() @@ -67,10 +62,6 @@ class Project(PolymorphicModel): class TextClassificationProject(Project): - @property - def image(self): - return staticfiles_storage.url('assets/images/cats/text_classification.jpg') - def get_bundle_name(self): return 'document_classification' @@ -94,10 +85,6 @@ class TextClassificationProject(Project): class SequenceLabelingProject(Project): - @property - def image(self): - return staticfiles_storage.url('assets/images/cats/sequence_labeling.jpg') - def get_bundle_name(self): return 'sequence_labeling' @@ -121,10 +108,6 @@ class SequenceLabelingProject(Project): class Seq2seqProject(Project): - @property - def image(self): - return staticfiles_storage.url('assets/images/cats/seq2seq.jpg') - def get_bundle_name(self): return 'seq2seq' @@ -148,10 +131,6 @@ class Seq2seqProject(Project): class Speech2textProject(Project): - @property - def image(self): - return staticfiles_storage.url('images/cats/speech2text.jpg') - def get_bundle_name(self): return 'speech2text' diff --git a/app/api/serializers.py b/app/api/serializers.py index 78444cc1..8c3d1950 100644 --- a/app/api/serializers.py +++ b/app/api/serializers.py @@ -119,9 +119,9 @@ class ProjectSerializer(serializers.ModelSerializer): class Meta: model = Project - fields = ('id', 'name', 'description', 'guideline', 'users', 'current_users_role', 'project_type', 'image', + fields = ('id', 'name', 'description', 'guideline', 'users', 'current_users_role', 'project_type', 'updated_at', 'randomize_document_order', 'collaborative_annotation', 'single_class_classification') - read_only_fields = ('image', 'updated_at', 'users', 'current_users_role') + read_only_fields = ('updated_at', 'users', 'current_users_role') class TextClassificationProjectSerializer(ProjectSerializer): @@ -152,9 +152,9 @@ class Speech2textProjectSerializer(ProjectSerializer): class Meta: model = Speech2textProject - fields = ('id', 'name', 'description', 'guideline', 'users', 'current_users_role', 'project_type', 'image', + fields = ('id', 'name', 'description', 'guideline', 'users', 'current_users_role', 'project_type', 'updated_at', 'randomize_document_order') - read_only_fields = ('image', 'updated_at', 'users', 'current_users_role') + read_only_fields = ('updated_at', 'users', 'current_users_role') class ProjectPolymorphicSerializer(PolymorphicSerializer): diff --git a/app/api/tests/test_models.py b/app/api/tests/test_models.py index 35f10393..781392ca 100644 --- a/app/api/tests/test_models.py +++ b/app/api/tests/test_models.py @@ -17,10 +17,6 @@ class TestTextClassificationProject(TestCase): def setUpTestData(cls): cls.project = mommy.make('TextClassificationProject') - def test_image(self): - image_url = self.project.image - self.assertTrue(image_url.endswith('.jpg')) - def test_get_bundle_name(self): template = self.project.get_bundle_name() self.assertEqual(template, 'document_classification') @@ -41,10 +37,6 @@ class TestSequenceLabelingProject(TestCase): def setUpTestData(cls): cls.project = mommy.make('SequenceLabelingProject') - def test_image(self): - image_url = self.project.image - self.assertTrue(image_url.endswith('.jpg')) - def test_get_bundle_name(self): template = self.project.get_bundle_name() self.assertEqual(template, 'sequence_labeling') @@ -65,10 +57,6 @@ class TestSeq2seqProject(TestCase): def setUpTestData(cls): cls.project = mommy.make('Seq2seqProject') - def test_image(self): - image_url = self.project.image - self.assertTrue(image_url.endswith('.jpg')) - def test_get_bundle_name(self): template = self.project.get_bundle_name() self.assertEqual(template, 'seq2seq') @@ -89,10 +77,6 @@ class TestSpeech2textProject(TestCase): def setUpTestData(cls): cls.project = mommy.make('Speech2textProject') - def test_image(self): - image_url = self.project.image - self.assertTrue(image_url.endswith('.jpg')) - def test_get_bundle_name(self): template = self.project.get_bundle_name() self.assertEqual(template, 'speech2text')