Switch to full app paths
Instead of inserting the path of the apps into the Python app, the apps are now referenced by their full import path. This solves name clashes with external or native Python libraries. Example: Mayan statistics app vs. Python new statistics library. Every app reference is now prepended with 'mayan.apps'. Existing config.yml files need to be updated manually. Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
default_app_config = 'document_comments.apps.DocumentCommentsApp'
|
||||
default_app_config = 'mayan.apps.document_comments.apps.DocumentCommentsApp'
|
||||
|
||||
@@ -4,8 +4,8 @@ from django.shortcuts import get_object_or_404
|
||||
|
||||
from rest_framework import generics
|
||||
|
||||
from acls.models import AccessControlList
|
||||
from documents.models import Document
|
||||
from mayan.apps.acls.models import AccessControlList
|
||||
from mayan.apps.documents.models import Document
|
||||
|
||||
from .permissions import (
|
||||
permission_comment_create, permission_comment_delete,
|
||||
|
||||
@@ -3,11 +3,11 @@ from __future__ import absolute_import, unicode_literals
|
||||
from django.apps import apps
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from acls import ModelPermission
|
||||
from common import MayanAppConfig, menu_facet, menu_object, menu_sidebar
|
||||
from documents.search import document_page_search, document_search
|
||||
from events import ModelEventType
|
||||
from navigation import SourceColumn
|
||||
from mayan.apps.acls import ModelPermission
|
||||
from mayan.apps.common import MayanAppConfig, menu_facet, menu_object, menu_sidebar
|
||||
from mayan.apps.documents.search import document_page_search, document_search
|
||||
from mayan.apps.events import ModelEventType
|
||||
from mayan.apps.navigation import SourceColumn
|
||||
|
||||
from .events import (
|
||||
event_document_comment_create, event_document_comment_delete
|
||||
@@ -26,7 +26,7 @@ class DocumentCommentsApp(MayanAppConfig):
|
||||
app_url = 'comments'
|
||||
has_rest_api = True
|
||||
has_tests = True
|
||||
name = 'document_comments'
|
||||
name = 'mayan.apps.document_comments'
|
||||
verbose_name = _('Document comments')
|
||||
|
||||
def ready(self):
|
||||
|
||||
@@ -2,7 +2,7 @@ from __future__ import absolute_import, unicode_literals
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from events import EventTypeNamespace
|
||||
from mayan.apps.events import EventTypeNamespace
|
||||
|
||||
namespace = EventTypeNamespace(
|
||||
name='document_comments', label=_('Document comments')
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
from appearance.classes import Icon
|
||||
from mayan.apps.appearance.classes import Icon
|
||||
|
||||
icon_comments_for_document = Icon(driver_name='fontawesome', symbol='comment')
|
||||
icon_comment_add = Icon(driver_name='fontawesome', symbol='plus')
|
||||
|
||||
@@ -2,7 +2,7 @@ from __future__ import unicode_literals, absolute_import
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from navigation import Link
|
||||
from mayan.apps.navigation import Link
|
||||
|
||||
from .icons import icon_comment_add, icon_comments_for_document
|
||||
from .permissions import (
|
||||
|
||||
@@ -7,7 +7,7 @@ from django.db import models
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from documents.models import Document
|
||||
from mayan.apps.documents.models import Document
|
||||
|
||||
from .events import (
|
||||
event_document_comment_create, event_document_comment_delete
|
||||
|
||||
@@ -2,7 +2,7 @@ from __future__ import absolute_import, unicode_literals
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from permissions import PermissionNamespace
|
||||
from mayan.apps.permissions import PermissionNamespace
|
||||
|
||||
namespace = PermissionNamespace('comments', _('Comments'))
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@ from __future__ import unicode_literals
|
||||
from rest_framework import serializers
|
||||
from rest_framework.reverse import reverse
|
||||
|
||||
from documents.serializers import DocumentSerializer
|
||||
from user_management.serializers import UserSerializer
|
||||
from mayan.apps.documents.serializers import DocumentSerializer
|
||||
from mayan.apps.user_management.serializers import UserSerializer
|
||||
|
||||
from .models import Comment
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@ from django.test import override_settings
|
||||
|
||||
from rest_framework import status
|
||||
|
||||
from documents.tests import DocumentTestMixin
|
||||
from rest_api.tests import BaseAPITestCase
|
||||
from mayan.apps.documents.tests import DocumentTestMixin
|
||||
from mayan.apps.rest_api.tests import BaseAPITestCase
|
||||
|
||||
from ..models import Comment
|
||||
from ..permissions import (
|
||||
|
||||
@@ -5,11 +5,11 @@ from django.template import RequestContext
|
||||
from django.urls import reverse
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from acls.models import AccessControlList
|
||||
from common.generics import (
|
||||
from mayan.apps.acls.models import AccessControlList
|
||||
from mayan.apps.common.generics import (
|
||||
SingleObjectCreateView, SingleObjectDeleteView, SingleObjectListView
|
||||
)
|
||||
from documents.models import Document
|
||||
from mayan.apps.documents.models import Document
|
||||
|
||||
from .icons import icon_comments_for_document
|
||||
from .links import link_comment_add
|
||||
|
||||
Reference in New Issue
Block a user