From e407dd17a399fc5ea606e51aacb856fb3d0234e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Barrag=C3=A1n=20Merino?= Date: Fri, 9 May 2014 12:16:28 +0200 Subject: [PATCH] Refactor mixins --- taiga/projects/issues/models.py | 7 +++---- taiga/projects/mixins/{blocked/models.py => blocked.py} | 5 +++++ taiga/projects/mixins/blocked/tests/foo/__init__.py | 0 taiga/projects/mixins/{blocked => }/tests/__init__.py | 0 .../mixins/{blocked => tests/blocked/foo}/__init__.py | 0 .../mixins/{blocked/tests => tests/blocked}/foo/models.py | 2 +- .../{blocked/tests => tests/blocked}/tests_models.py | 0 taiga/projects/tasks/models.py | 4 +--- 8 files changed, 10 insertions(+), 8 deletions(-) rename taiga/projects/mixins/{blocked/models.py => blocked.py} (97%) delete mode 100644 taiga/projects/mixins/blocked/tests/foo/__init__.py rename taiga/projects/mixins/{blocked => }/tests/__init__.py (100%) rename taiga/projects/mixins/{blocked => tests/blocked/foo}/__init__.py (100%) rename taiga/projects/mixins/{blocked/tests => tests/blocked}/foo/models.py (93%) rename taiga/projects/mixins/{blocked/tests => tests/blocked}/tests_models.py (100%) diff --git a/taiga/projects/issues/models.py b/taiga/projects/issues/models.py index 3587225c..6ad645b6 100644 --- a/taiga/projects/issues/models.py +++ b/taiga/projects/issues/models.py @@ -25,12 +25,11 @@ from picklefield.fields import PickledObjectField from taiga.base.models import NeighborsMixin from taiga.base.utils.slug import ref_uniquely -from taiga.base.notifications.models import WatchedMixin -from taiga.projects.mixins.blocked.models import BlockedMixin +from taiga.projects.notifications.models import WatchedMixin +from taiga.projects.mixins.blocked import BlockedMixin - -class Issue(NeighborsMixin, WatchedMixin, BlockedMixin): +class Issue(NeighborsMixin, WatchedMixin, BlockedMixin, models.Model): ref = models.BigIntegerField(db_index=True, null=True, blank=True, default=None, verbose_name=_("ref")) owner = models.ForeignKey(settings.AUTH_USER_MODEL, null=True, blank=True, default=None, diff --git a/taiga/projects/mixins/blocked/models.py b/taiga/projects/mixins/blocked.py similarity index 97% rename from taiga/projects/mixins/blocked/models.py rename to taiga/projects/mixins/blocked.py index 6c988a88..43ce45e7 100644 --- a/taiga/projects/mixins/blocked/models.py +++ b/taiga/projects/mixins/blocked.py @@ -14,6 +14,11 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . + +########## +# MODELS # +########## + from django.db import models from django.utils.translation import ugettext_lazy as _ from django.dispatch import receiver diff --git a/taiga/projects/mixins/blocked/tests/foo/__init__.py b/taiga/projects/mixins/blocked/tests/foo/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/taiga/projects/mixins/blocked/tests/__init__.py b/taiga/projects/mixins/tests/__init__.py similarity index 100% rename from taiga/projects/mixins/blocked/tests/__init__.py rename to taiga/projects/mixins/tests/__init__.py diff --git a/taiga/projects/mixins/blocked/__init__.py b/taiga/projects/mixins/tests/blocked/foo/__init__.py similarity index 100% rename from taiga/projects/mixins/blocked/__init__.py rename to taiga/projects/mixins/tests/blocked/foo/__init__.py diff --git a/taiga/projects/mixins/blocked/tests/foo/models.py b/taiga/projects/mixins/tests/blocked/foo/models.py similarity index 93% rename from taiga/projects/mixins/blocked/tests/foo/models.py rename to taiga/projects/mixins/tests/blocked/foo/models.py index c38af868..1f7e259c 100644 --- a/taiga/projects/mixins/blocked/tests/foo/models.py +++ b/taiga/projects/mixins/tests/blocked/foo/models.py @@ -14,7 +14,7 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -from taiga.projects.mixins.blocked.models import BlockedMixin +from taiga.projects.mixins.blocked import BlockedMixin class BlockedFoo(BlockedMixin): diff --git a/taiga/projects/mixins/blocked/tests/tests_models.py b/taiga/projects/mixins/tests/blocked/tests_models.py similarity index 100% rename from taiga/projects/mixins/blocked/tests/tests_models.py rename to taiga/projects/mixins/tests/blocked/tests_models.py diff --git a/taiga/projects/tasks/models.py b/taiga/projects/tasks/models.py index 3503253d..b98cf588 100644 --- a/taiga/projects/tasks/models.py +++ b/taiga/projects/tasks/models.py @@ -27,9 +27,7 @@ from taiga.base.utils.slug import ref_uniquely from taiga.projects.notifications.models import WatchedMixin from taiga.projects.userstories.models import UserStory from taiga.projects.milestones.models import Milestone -from taiga.projects.mixins.blocked.models import BlockedMixin - -import reversion +from taiga.projects.mixins.blocked import BlockedMixin class Task(WatchedMixin, BlockedMixin):