Multiple apps: Sort imports and minor style fixes
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
This commit is contained in:
@@ -4,7 +4,9 @@ from django.apps import apps
|
|||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
from mayan.apps.acls import ModelPermission
|
from mayan.apps.acls import ModelPermission
|
||||||
from mayan.apps.common import MayanAppConfig, menu_facet, menu_object, menu_sidebar
|
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.documents.search import document_page_search, document_search
|
||||||
from mayan.apps.events import ModelEventType
|
from mayan.apps.events import ModelEventType
|
||||||
from mayan.apps.navigation import SourceColumn
|
from mayan.apps.navigation import SourceColumn
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
from __future__ import unicode_literals, absolute_import
|
from __future__ import absolute_import, unicode_literals
|
||||||
|
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
def migrate_old_comments(apps, schema_editor):
|
def migrate_old_comments(apps, schema_editor):
|
||||||
@@ -23,7 +22,9 @@ def migrate_old_comments(apps, schema_editor):
|
|||||||
|
|
||||||
for old_comment in OldComment.objects.using(schema_editor.connection.alias).all():
|
for old_comment in OldComment.objects.using(schema_editor.connection.alias).all():
|
||||||
comment = Comment(
|
comment = Comment(
|
||||||
document=Document.objects.using(schema_editor.connection.alias).get(pk=old_comment.object_pk),
|
document=Document.objects.using(
|
||||||
|
schema_editor.connection.alias
|
||||||
|
).get(pk=old_comment.object_pk),
|
||||||
user=User(old_comment.user.pk),
|
user=User(old_comment.user.pk),
|
||||||
comment=old_comment.comment,
|
comment=old_comment.comment,
|
||||||
submit_date=old_comment.submit_date,
|
submit_date=old_comment.submit_date,
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|||||||
@@ -1,37 +1,41 @@
|
|||||||
from __future__ import absolute_import, unicode_literals
|
from __future__ import absolute_import, unicode_literals
|
||||||
|
|
||||||
from kombu import Exchange, Queue
|
|
||||||
|
|
||||||
from django.apps import apps
|
from django.apps import apps
|
||||||
from django.db.models.signals import post_delete, post_save, pre_delete
|
from django.db.models.signals import post_delete, post_save, pre_delete
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
|
from kombu import Exchange, Queue
|
||||||
|
|
||||||
from mayan.apps.acls import ModelPermission
|
from mayan.apps.acls import ModelPermission
|
||||||
from mayan.apps.acls.links import link_acl_list
|
from mayan.apps.acls.links import link_acl_list
|
||||||
from mayan.apps.acls.permissions import permission_acl_edit, permission_acl_view
|
from mayan.apps.acls.permissions import (
|
||||||
|
permission_acl_edit, permission_acl_view
|
||||||
|
)
|
||||||
from mayan.apps.common import (
|
from mayan.apps.common import (
|
||||||
MayanAppConfig, menu_facet, menu_list_facet, menu_main, menu_object,
|
MayanAppConfig, menu_facet, menu_list_facet, menu_main, menu_object,
|
||||||
menu_secondary, menu_setup, menu_tools
|
menu_secondary, menu_setup, menu_tools
|
||||||
)
|
)
|
||||||
from mayan.apps.common.widgets import TwoStateWidget
|
from mayan.apps.common.widgets import TwoStateWidget
|
||||||
from mayan.apps.documents.signals import post_document_created, post_initial_document_type
|
from mayan.apps.documents.signals import (
|
||||||
|
post_document_created, post_initial_document_type
|
||||||
|
)
|
||||||
from mayan.apps.navigation import SourceColumn
|
from mayan.apps.navigation import SourceColumn
|
||||||
from mayan.celery import app
|
from mayan.celery import app
|
||||||
|
|
||||||
from .handlers import (
|
from .handlers import (
|
||||||
create_default_document_index, handler_delete_empty,
|
create_default_document_index, handler_delete_empty,
|
||||||
handler_index_document, handler_remove_document,
|
handler_index_document, handler_post_save_index_document,
|
||||||
handler_post_save_index_document
|
handler_remove_document
|
||||||
)
|
)
|
||||||
|
from .licenses import * # NOQA
|
||||||
from .links import (
|
from .links import (
|
||||||
link_document_index_list, link_index_main_menu, link_index_setup,
|
link_document_index_list, link_index_main_menu, link_index_setup,
|
||||||
link_index_setup_create, link_index_setup_document_types,
|
link_index_setup_create, link_index_setup_delete,
|
||||||
link_index_setup_delete, link_index_setup_edit, link_index_setup_list,
|
link_index_setup_document_types, link_index_setup_edit,
|
||||||
link_index_setup_view, link_rebuild_index_instances,
|
link_index_setup_list, link_index_setup_view, link_rebuild_index_instances,
|
||||||
link_template_node_create, link_template_node_delete,
|
link_template_node_create, link_template_node_delete,
|
||||||
link_template_node_edit
|
link_template_node_edit
|
||||||
)
|
)
|
||||||
from .licenses import * # NOQA
|
|
||||||
from .permissions import (
|
from .permissions import (
|
||||||
permission_document_indexing_create, permission_document_indexing_delete,
|
permission_document_indexing_create, permission_document_indexing_delete,
|
||||||
permission_document_indexing_edit,
|
permission_document_indexing_edit,
|
||||||
|
|||||||
@@ -2,16 +2,16 @@ from __future__ import unicode_literals
|
|||||||
|
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
from mayan.apps.navigation import Link, get_cascade_condition
|
|
||||||
from mayan.apps.documents.icons import icon_document_type
|
from mayan.apps.documents.icons import icon_document_type
|
||||||
|
from mayan.apps.navigation import Link, get_cascade_condition
|
||||||
|
|
||||||
from .icons import (
|
from .icons import (
|
||||||
icon_document_index_list, icon_index, icon_index_create,
|
icon_document_index_list, icon_index, icon_index_create,
|
||||||
icon_index_setup_view, icon_rebuild_index_instances,
|
icon_index_setup_view, icon_rebuild_index_instances
|
||||||
)
|
)
|
||||||
from .permissions import (
|
from .permissions import (
|
||||||
permission_document_indexing_create, permission_document_indexing_edit,
|
permission_document_indexing_create, permission_document_indexing_delete,
|
||||||
permission_document_indexing_delete,
|
permission_document_indexing_edit,
|
||||||
permission_document_indexing_instance_view,
|
permission_document_indexing_instance_view,
|
||||||
permission_document_indexing_rebuild, permission_document_indexing_view
|
permission_document_indexing_rebuild, permission_document_indexing_view
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import migrations, models
|
||||||
|
|
||||||
import mptt.fields
|
import mptt.fields
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.10.6 on 2017-05-24 04:56
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.10.7 on 2017-05-30 07:28
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
import django.db.models.deletion
|
import django.db.models.deletion
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
@@ -16,16 +14,28 @@ class Migration(migrations.Migration):
|
|||||||
migrations.AlterField(
|
migrations.AlterField(
|
||||||
model_name='index',
|
model_name='index',
|
||||||
name='slug',
|
name='slug',
|
||||||
field=models.SlugField(help_text='This value will be used by other apps to reference this index.', max_length=128, unique=True, verbose_name='Slug'),
|
field=models.SlugField(
|
||||||
|
help_text='This value will be used by other apps to '
|
||||||
|
'reference this index.', max_length=128, unique=True,
|
||||||
|
verbose_name='Slug'
|
||||||
|
),
|
||||||
),
|
),
|
||||||
migrations.AlterField(
|
migrations.AlterField(
|
||||||
model_name='indexinstancenode',
|
model_name='indexinstancenode',
|
||||||
name='documents',
|
name='documents',
|
||||||
field=models.ManyToManyField(related_name='index_instance_nodes', to='documents.Document', verbose_name='Documents'),
|
field=models.ManyToManyField(
|
||||||
|
related_name='index_instance_nodes', to='documents.Document',
|
||||||
|
verbose_name='Documents'
|
||||||
|
),
|
||||||
),
|
),
|
||||||
migrations.AlterField(
|
migrations.AlterField(
|
||||||
model_name='indexinstancenode',
|
model_name='indexinstancenode',
|
||||||
name='index_template_node',
|
name='index_template_node',
|
||||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='index_instance_nodes', to='document_indexing.IndexTemplateNode', verbose_name='Index template node'),
|
field=models.ForeignKey(
|
||||||
|
on_delete=django.db.models.deletion.CASCADE,
|
||||||
|
related_name='index_instance_nodes',
|
||||||
|
to='document_indexing.IndexTemplateNode',
|
||||||
|
verbose_name='Index template node'
|
||||||
|
),
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.10.7 on 2017-07-14 21:33
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
@@ -14,6 +12,10 @@ class Migration(migrations.Migration):
|
|||||||
operations = [
|
operations = [
|
||||||
migrations.AlterModelOptions(
|
migrations.AlterModelOptions(
|
||||||
name='index',
|
name='index',
|
||||||
options={'ordering': ('label',), 'verbose_name': 'Index', 'verbose_name_plural': 'Indexes'},
|
options={
|
||||||
|
'ordering': ('label',),
|
||||||
|
'verbose_name': 'Index',
|
||||||
|
'verbose_name_plural': 'Indexes'
|
||||||
|
},
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.11.11 on 2018-08-23 23:53
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
@@ -15,6 +13,10 @@ class Migration(migrations.Migration):
|
|||||||
migrations.AlterField(
|
migrations.AlterField(
|
||||||
model_name='indextemplatenode',
|
model_name='indextemplatenode',
|
||||||
name='expression',
|
name='expression',
|
||||||
field=models.TextField(help_text="Enter a template to render. Use Django's default templating language (https://docs.djangoproject.com/en/1.11/ref/templates/builtins/)", verbose_name='Indexing expression'),
|
field=models.TextField(
|
||||||
|
help_text="Enter a template to render. Use Django's default "
|
||||||
|
"templating language (https://docs.djangoproject.com/en/1.11/"
|
||||||
|
"ref/templates/builtins/)", verbose_name='Indexing expression'
|
||||||
|
),
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -7,7 +7,8 @@ from jinja2 import Template
|
|||||||
from django.db import models, transaction
|
from django.db import models, transaction
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
from django.utils.encoding import force_text, python_2_unicode_compatible
|
from django.utils.encoding import force_text, python_2_unicode_compatible
|
||||||
from django.utils.translation import ugettext, ugettext_lazy as _
|
from django.utils.translation import ugettext
|
||||||
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
from mptt.fields import TreeForeignKey
|
from mptt.fields import TreeForeignKey
|
||||||
from mptt.models import MPTTModel
|
from mptt.models import MPTTModel
|
||||||
@@ -19,7 +20,7 @@ from mayan.apps.lock_manager import LockError
|
|||||||
from mayan.apps.lock_manager.runtime import locking_backend
|
from mayan.apps.lock_manager.runtime import locking_backend
|
||||||
|
|
||||||
from .managers import (
|
from .managers import (
|
||||||
DocumentIndexInstanceNodeManager, IndexManager, IndexInstanceNodeManager
|
DocumentIndexInstanceNodeManager, IndexInstanceNodeManager, IndexManager
|
||||||
)
|
)
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|||||||
@@ -5,13 +5,13 @@ from django.utils.encoding import force_text
|
|||||||
|
|
||||||
from mayan.apps.common.tests import BaseTestCase
|
from mayan.apps.common.tests import BaseTestCase
|
||||||
from mayan.apps.documents.tests import (
|
from mayan.apps.documents.tests import (
|
||||||
DocumentTestMixin, TEST_SMALL_DOCUMENT_PATH
|
TEST_SMALL_DOCUMENT_PATH, DocumentTestMixin
|
||||||
)
|
)
|
||||||
from mayan.apps.documents.tests.literals import (
|
from mayan.apps.documents.tests.literals import (
|
||||||
TEST_DOCUMENT_DESCRIPTION, TEST_DOCUMENT_DESCRIPTION_EDITED,
|
TEST_DOCUMENT_DESCRIPTION, TEST_DOCUMENT_DESCRIPTION_EDITED,
|
||||||
TEST_DOCUMENT_LABEL_EDITED
|
TEST_DOCUMENT_LABEL_EDITED
|
||||||
)
|
)
|
||||||
from mayan.apps.metadata.models import MetadataType, DocumentTypeMetadataType
|
from mayan.apps.metadata.models import DocumentTypeMetadataType, MetadataType
|
||||||
|
|
||||||
from ..models import Index, IndexInstanceNode, IndexTemplateNode
|
from ..models import Index, IndexInstanceNode, IndexTemplateNode
|
||||||
|
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ from .api_views import (
|
|||||||
)
|
)
|
||||||
from .views import (
|
from .views import (
|
||||||
DocumentIndexNodeListView, IndexInstanceNodeView, IndexListView,
|
DocumentIndexNodeListView, IndexInstanceNodeView, IndexListView,
|
||||||
RebuildIndexesView, SetupIndexDocumentTypesView, SetupIndexCreateView,
|
RebuildIndexesView, SetupIndexCreateView, SetupIndexDeleteView,
|
||||||
SetupIndexDeleteView, SetupIndexEditView, SetupIndexListView,
|
SetupIndexDocumentTypesView, SetupIndexEditView, SetupIndexListView,
|
||||||
SetupIndexTreeTemplateListView, TemplateNodeCreateView,
|
SetupIndexTreeTemplateListView, TemplateNodeCreateView,
|
||||||
TemplateNodeDeleteView, TemplateNodeEditView
|
TemplateNodeDeleteView, TemplateNodeEditView
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -5,12 +5,13 @@ from django.shortcuts import get_object_or_404
|
|||||||
from django.template import RequestContext
|
from django.template import RequestContext
|
||||||
from django.urls import reverse, reverse_lazy
|
from django.urls import reverse, reverse_lazy
|
||||||
from django.utils.html import mark_safe
|
from django.utils.html import mark_safe
|
||||||
from django.utils.translation import ugettext_lazy as _, ungettext
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
from django.utils.translation import ungettext
|
||||||
|
|
||||||
from mayan.apps.acls.models import AccessControlList
|
from mayan.apps.acls.models import AccessControlList
|
||||||
from mayan.apps.common.views import (
|
from mayan.apps.common.views import (
|
||||||
AssignRemoveView, FormView, SingleObjectCreateView,
|
AssignRemoveView, FormView, SingleObjectCreateView, SingleObjectDeleteView,
|
||||||
SingleObjectDeleteView, SingleObjectEditView, SingleObjectListView
|
SingleObjectEditView, SingleObjectListView
|
||||||
)
|
)
|
||||||
from mayan.apps.documents.models import Document, DocumentType
|
from mayan.apps.documents.models import Document, DocumentType
|
||||||
from mayan.apps.documents.permissions import permission_document_view
|
from mayan.apps.documents.permissions import permission_document_view
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ from __future__ import unicode_literals
|
|||||||
|
|
||||||
from django.apps import apps
|
from django.apps import apps
|
||||||
from django.utils.encoding import force_text
|
from django.utils.encoding import force_text
|
||||||
from django.utils.html import mark_safe, escape
|
from django.utils.html import escape, mark_safe
|
||||||
|
|
||||||
from .icons import icon_index, icon_index_level_up, icon_node_with_documents
|
from .icons import icon_index, icon_index_level_up, icon_node_with_documents
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,7 @@ from __future__ import unicode_literals
|
|||||||
|
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
|
||||||
from .models import (
|
from .models import DocumentPageContent, DocumentVersionParseError
|
||||||
DocumentPageContent, DocumentVersionParseError
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@admin.register(DocumentPageContent)
|
@admin.register(DocumentPageContent)
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from datetime import timedelta
|
|
||||||
import logging
|
import logging
|
||||||
|
from datetime import timedelta
|
||||||
from kombu import Exchange, Queue
|
|
||||||
|
|
||||||
from django.apps import apps
|
from django.apps import apps
|
||||||
from django.db.models.signals import post_save
|
from django.db.models.signals import post_save
|
||||||
from django.utils.timezone import now
|
from django.utils.timezone import now
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
|
from kombu import Exchange, Queue
|
||||||
|
|
||||||
from mayan.apps.acls import ModelPermission
|
from mayan.apps.acls import ModelPermission
|
||||||
from mayan.apps.common import (
|
from mayan.apps.common import (
|
||||||
MayanAppConfig, menu_facet, menu_multi_item, menu_object, menu_secondary,
|
MayanAppConfig, menu_facet, menu_multi_item, menu_object, menu_secondary,
|
||||||
@@ -17,7 +17,7 @@ from mayan.apps.common import (
|
|||||||
)
|
)
|
||||||
from mayan.apps.common.classes import ModelAttribute, ModelField
|
from mayan.apps.common.classes import ModelAttribute, ModelField
|
||||||
from mayan.apps.common.settings import settings_db_sync_task_delay
|
from mayan.apps.common.settings import settings_db_sync_task_delay
|
||||||
from mayan.apps.documents.search import document_search, document_page_search
|
from mayan.apps.documents.search import document_page_search, document_search
|
||||||
from mayan.apps.documents.signals import post_version_upload
|
from mayan.apps.documents.signals import post_version_upload
|
||||||
from mayan.apps.documents.widgets import document_link
|
from mayan.apps.documents.widgets import document_link
|
||||||
from mayan.apps.navigation import SourceColumn
|
from mayan.apps.navigation import SourceColumn
|
||||||
@@ -29,9 +29,9 @@ from .handlers import (
|
|||||||
handler_parse_document_version
|
handler_parse_document_version
|
||||||
)
|
)
|
||||||
from .links import (
|
from .links import (
|
||||||
link_document_content, link_document_page_content,
|
link_document_content, link_document_content_download,
|
||||||
link_document_content_download, link_document_parsing_errors_list,
|
link_document_page_content, link_document_parsing_errors_list,
|
||||||
link_document_submit_multiple, link_document_submit,
|
link_document_submit, link_document_submit_multiple,
|
||||||
link_document_type_parsing_settings, link_document_type_submit,
|
link_document_type_parsing_settings, link_document_type_submit,
|
||||||
link_error_list
|
link_error_list
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -4,7 +4,8 @@ from django import forms
|
|||||||
from django.utils.encoding import force_text
|
from django.utils.encoding import force_text
|
||||||
from django.utils.html import conditional_escape
|
from django.utils.html import conditional_escape
|
||||||
from django.utils.safestring import mark_safe
|
from django.utils.safestring import mark_safe
|
||||||
from django.utils.translation import ugettext_lazy as _, ugettext
|
from django.utils.translation import ugettext
|
||||||
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
from mayan.apps.acls.models import AccessControlList
|
from mayan.apps.acls.models import AccessControlList
|
||||||
from mayan.apps.common.widgets import TextAreaDiv
|
from mayan.apps.common.widgets import TextAreaDiv
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ from django.utils.translation import ugettext_lazy as _
|
|||||||
from mayan.apps.navigation import Link, get_cascade_condition
|
from mayan.apps.navigation import Link, get_cascade_condition
|
||||||
|
|
||||||
from .icons import (
|
from .icons import (
|
||||||
icon_document_content, icon_document_parsing_errors_list,
|
icon_document_content, icon_document_content_download,
|
||||||
icon_document_content_download, icon_document_type_parsing_settings,
|
icon_document_parsing_errors_list, icon_document_type_parsing_settings,
|
||||||
icon_document_type_submit, icon_link_error_list
|
icon_document_type_submit, icon_link_error_list
|
||||||
)
|
)
|
||||||
from .permissions import (
|
from .permissions import (
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.10.7 on 2017-08-23 18:55
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
import django.db.models.deletion
|
import django.db.models.deletion
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.10.7 on 2017-08-27 16:17
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
import django.db.models.deletion
|
import django.db.models.deletion
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|||||||
@@ -1,29 +1,35 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.11.11 on 2018-04-10 06:39
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
import django.db.models.deletion
|
import django.db.models.deletion
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
def create_parsing_setting_for_existing_document_types(apps, schema_editor):
|
def create_parsing_setting_for_existing_document_types(apps, schema_editor):
|
||||||
DocumentType = apps.get_model('documents', 'DocumentType')
|
DocumentType = apps.get_model('documents', 'DocumentType')
|
||||||
DocumentTypeSettings = apps.get_model('document_parsing', 'DocumentTypeSettings')
|
DocumentTypeSettings = apps.get_model(
|
||||||
|
'document_parsing', 'DocumentTypeSettings'
|
||||||
|
)
|
||||||
|
|
||||||
for document_type in DocumentType.objects.using(schema_editor.connection.alias).all():
|
for document_type in DocumentType.objects.using(schema_editor.connection.alias).all():
|
||||||
try:
|
try:
|
||||||
DocumentTypeSettings.objects.using(schema_editor.connection.alias).create(document_type=document_type)
|
DocumentTypeSettings.objects.using(
|
||||||
|
schema_editor.connection.alias
|
||||||
|
).create(document_type=document_type)
|
||||||
except DocumentTypeSettings.DoesNotExist:
|
except DocumentTypeSettings.DoesNotExist:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
def delete_parsing_setting_for_existing_document_types(apps, schema_editor):
|
def delete_parsing_setting_for_existing_document_types(apps, schema_editor):
|
||||||
DocumentType = apps.get_model('documents', 'DocumentType')
|
DocumentType = apps.get_model('documents', 'DocumentType')
|
||||||
DocumentTypeSettings = apps.get_model('document_parsing', 'DocumentTypeSettings')
|
DocumentTypeSettings = apps.get_model(
|
||||||
|
'document_parsing', 'DocumentTypeSettings'
|
||||||
|
)
|
||||||
|
|
||||||
for document_type in DocumentType.objects.using(schema_editor.connection.alias).all():
|
for document_type in DocumentType.objects.using(schema_editor.connection.alias).all():
|
||||||
try:
|
try:
|
||||||
DocumentTypeSettings.objects.using(schema_editor.connection.alias).get(document_type=document_type).delete()
|
DocumentTypeSettings.objects.using(
|
||||||
|
schema_editor.connection.alias
|
||||||
|
).get(document_type=document_type).delete()
|
||||||
except DocumentTypeSettings.DoesNotExist:
|
except DocumentTypeSettings.DoesNotExist:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@@ -39,9 +45,26 @@ class Migration(migrations.Migration):
|
|||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name='DocumentTypeSettings',
|
name='DocumentTypeSettings',
|
||||||
fields=[
|
fields=[
|
||||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
(
|
||||||
('auto_parsing', models.BooleanField(default=True, verbose_name='Automatically queue newly created documents for parsing.')),
|
'id', models.AutoField(
|
||||||
('document_type', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='parsing_settings', to='documents.DocumentType', verbose_name='Document type')),
|
auto_created=True, primary_key=True, serialize=False,
|
||||||
|
verbose_name='ID'
|
||||||
|
)
|
||||||
|
),
|
||||||
|
(
|
||||||
|
'auto_parsing', models.BooleanField(
|
||||||
|
default=True, verbose_name='Automatically queue newly '
|
||||||
|
'created documents for parsing.'
|
||||||
|
)
|
||||||
|
),
|
||||||
|
(
|
||||||
|
'document_type', models.OneToOneField(
|
||||||
|
on_delete=django.db.models.deletion.CASCADE,
|
||||||
|
related_name='parsing_settings',
|
||||||
|
to='documents.DocumentType',
|
||||||
|
verbose_name='Document type'
|
||||||
|
)
|
||||||
|
),
|
||||||
],
|
],
|
||||||
options={
|
options={
|
||||||
'verbose_name': 'Document type settings',
|
'verbose_name': 'Document type settings',
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.11.11 on 2018-09-17 06:45
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
@@ -15,6 +13,9 @@ class Migration(migrations.Migration):
|
|||||||
migrations.AlterField(
|
migrations.AlterField(
|
||||||
model_name='documentpagecontent',
|
model_name='documentpagecontent',
|
||||||
name='content',
|
name='content',
|
||||||
field=models.TextField(blank=True, help_text='The actual text content as extracted by the document parsing backend.', verbose_name='Content'),
|
field=models.TextField(
|
||||||
|
blank=True, help_text='The actual text content as extracted '
|
||||||
|
'by the document parsing backend.', verbose_name='Content'
|
||||||
|
),
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
TEST_DOCUMENT_CONTENT = 'Sample text'
|
||||||
TEST_PARSING_INDEX_NODE_TEMPLATE = '{% if "sample" in document.content.lower() %}sample{% endif %}'
|
TEST_PARSING_INDEX_NODE_TEMPLATE = '{% if "sample" in document.content.lower() %}sample{% endif %}'
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ from django.test import override_settings
|
|||||||
|
|
||||||
from rest_framework import status
|
from rest_framework import status
|
||||||
|
|
||||||
from mayan.apps.documents.tests import DocumentTestMixin, TEST_HYBRID_DOCUMENT
|
from mayan.apps.documents.tests import TEST_HYBRID_DOCUMENT, DocumentTestMixin
|
||||||
from mayan.apps.rest_api.tests import BaseAPITestCase
|
from mayan.apps.rest_api.tests import BaseAPITestCase
|
||||||
|
|
||||||
from ..permissions import permission_content_view
|
from ..permissions import permission_content_view
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ from mayan.apps.documents.tests.literals import TEST_DOCUMENT_FILENAME
|
|||||||
from mayan.apps.documents.tests.test_models import GenericDocumentTestCase
|
from mayan.apps.documents.tests.test_models import GenericDocumentTestCase
|
||||||
|
|
||||||
from ..events import (
|
from ..events import (
|
||||||
event_parsing_document_version_submit,
|
event_parsing_document_version_finish,
|
||||||
event_parsing_document_version_finish
|
event_parsing_document_version_submit
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ from __future__ import unicode_literals
|
|||||||
from django.test import override_settings
|
from django.test import override_settings
|
||||||
|
|
||||||
from mayan.apps.common.tests import BaseTestCase
|
from mayan.apps.common.tests import BaseTestCase
|
||||||
from mayan.apps.documents.tests import DocumentTestMixin, TEST_HYBRID_DOCUMENT
|
|
||||||
from mayan.apps.document_indexing.models import Index, IndexInstanceNode
|
from mayan.apps.document_indexing.models import Index, IndexInstanceNode
|
||||||
from mayan.apps.document_indexing.tests.literals import TEST_INDEX_LABEL
|
from mayan.apps.document_indexing.tests.literals import TEST_INDEX_LABEL
|
||||||
|
from mayan.apps.documents.tests import TEST_HYBRID_DOCUMENT, DocumentTestMixin
|
||||||
|
|
||||||
from .literals import TEST_PARSING_INDEX_NODE_TEMPLATE
|
from .literals import TEST_PARSING_INDEX_NODE_TEMPLATE
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,11 @@ from __future__ import unicode_literals
|
|||||||
|
|
||||||
from django.test import override_settings
|
from django.test import override_settings
|
||||||
|
|
||||||
from mayan.apps.documents.tests import GenericDocumentTestCase, TEST_HYBRID_DOCUMENT
|
from mayan.apps.documents.tests import (
|
||||||
|
TEST_HYBRID_DOCUMENT, GenericDocumentTestCase
|
||||||
|
)
|
||||||
|
|
||||||
TEST_DOCUMENT_CONTENT = 'Sample text'
|
from .literals import TEST_DOCUMENT_CONTENT
|
||||||
|
|
||||||
|
|
||||||
class DocumentAutoParsingTestCase(GenericDocumentTestCase):
|
class DocumentAutoParsingTestCase(GenericDocumentTestCase):
|
||||||
|
|||||||
@@ -3,11 +3,11 @@ from __future__ import unicode_literals
|
|||||||
from django.test import override_settings
|
from django.test import override_settings
|
||||||
|
|
||||||
from mayan.apps.common.tests import BaseTestCase
|
from mayan.apps.common.tests import BaseTestCase
|
||||||
from mayan.apps.documents.tests import DocumentTestMixin, TEST_HYBRID_DOCUMENT
|
from mayan.apps.documents.tests import TEST_HYBRID_DOCUMENT, DocumentTestMixin
|
||||||
|
|
||||||
from ..parsers import PopplerParser
|
from ..parsers import PopplerParser
|
||||||
|
|
||||||
TEST_DOCUMENT_CONTENT = 'Sample text'
|
from .literals import TEST_DOCUMENT_CONTENT
|
||||||
|
|
||||||
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
@override_settings(OCR_AUTO_OCR=False)
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ from __future__ import unicode_literals
|
|||||||
from django.test import override_settings
|
from django.test import override_settings
|
||||||
|
|
||||||
from mayan.apps.documents.tests import (
|
from mayan.apps.documents.tests import (
|
||||||
GenericDocumentViewTestCase, TEST_HYBRID_DOCUMENT
|
TEST_HYBRID_DOCUMENT, GenericDocumentViewTestCase
|
||||||
)
|
)
|
||||||
|
|
||||||
from ..permissions import (
|
from ..permissions import (
|
||||||
@@ -11,7 +11,7 @@ from ..permissions import (
|
|||||||
)
|
)
|
||||||
from ..utils import get_document_content
|
from ..utils import get_document_content
|
||||||
|
|
||||||
TEST_DOCUMENT_CONTENT = 'Sample text'
|
from .literals import TEST_DOCUMENT_CONTENT
|
||||||
|
|
||||||
|
|
||||||
@override_settings(DOCUMENT_PARSING_AUTO_PARSING=True)
|
@override_settings(DOCUMENT_PARSING_AUTO_PARSING=True)
|
||||||
|
|||||||
@@ -4,10 +4,9 @@ from django.conf.urls import url
|
|||||||
|
|
||||||
from .api_views import APIDocumentPageContentView
|
from .api_views import APIDocumentPageContentView
|
||||||
from .views import (
|
from .views import (
|
||||||
DocumentContentView, DocumentContentDownloadView,
|
DocumentContentDownloadView, DocumentContentView, DocumentPageContentView,
|
||||||
DocumentPageContentView, DocumentParsingErrorsListView,
|
DocumentParsingErrorsListView, DocumentSubmitView,
|
||||||
DocumentSubmitView, DocumentTypeSettingsEditView, DocumentTypeSubmitView,
|
DocumentTypeSettingsEditView, DocumentTypeSubmitView, ParseErrorListView
|
||||||
ParseErrorListView
|
|
||||||
)
|
)
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
|
|||||||
@@ -4,7 +4,8 @@ from django.contrib import messages
|
|||||||
from django.http import HttpResponseRedirect
|
from django.http import HttpResponseRedirect
|
||||||
from django.shortcuts import get_object_or_404
|
from django.shortcuts import get_object_or_404
|
||||||
from django.urls import reverse, reverse_lazy
|
from django.urls import reverse, reverse_lazy
|
||||||
from django.utils.translation import ugettext_lazy as _, ungettext
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
from django.utils.translation import ungettext
|
||||||
|
|
||||||
from mayan.apps.common.generics import (
|
from mayan.apps.common.generics import (
|
||||||
FormView, MultipleObjectConfirmActionView, SingleObjectDetailView,
|
FormView, MultipleObjectConfirmActionView, SingleObjectDetailView,
|
||||||
|
|||||||
@@ -2,12 +2,12 @@ from __future__ import unicode_literals
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from kombu import Exchange, Queue
|
|
||||||
|
|
||||||
from django.apps import apps
|
from django.apps import apps
|
||||||
from django.db.models.signals import post_save, post_delete
|
from django.db.models.signals import post_delete, post_save
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
|
from kombu import Exchange, Queue
|
||||||
|
|
||||||
from mayan.apps.acls import ModelPermission
|
from mayan.apps.acls import ModelPermission
|
||||||
from mayan.apps.common import (
|
from mayan.apps.common import (
|
||||||
MayanAppConfig, menu_facet, menu_object, menu_sidebar, menu_tools
|
MayanAppConfig, menu_facet, menu_object, menu_sidebar, menu_tools
|
||||||
@@ -17,15 +17,14 @@ from mayan.celery import app
|
|||||||
|
|
||||||
from .handlers import unverify_key_signatures, verify_key_signatures
|
from .handlers import unverify_key_signatures, verify_key_signatures
|
||||||
from .links import (
|
from .links import (
|
||||||
link_all_document_version_signature_verify,
|
link_all_document_version_signature_verify, link_document_signature_list,
|
||||||
link_document_signature_list,
|
|
||||||
link_document_version_signature_delete,
|
link_document_version_signature_delete,
|
||||||
link_document_version_signature_detached_create,
|
link_document_version_signature_detached_create,
|
||||||
link_document_version_signature_embedded_create,
|
|
||||||
link_document_version_signature_details,
|
link_document_version_signature_details,
|
||||||
link_document_version_signature_download,
|
link_document_version_signature_download,
|
||||||
|
link_document_version_signature_embedded_create,
|
||||||
link_document_version_signature_list,
|
link_document_version_signature_list,
|
||||||
link_document_version_signature_upload,
|
link_document_version_signature_upload
|
||||||
)
|
)
|
||||||
from .permissions import (
|
from .permissions import (
|
||||||
permission_document_version_sign_detached,
|
permission_document_version_sign_detached,
|
||||||
@@ -33,7 +32,7 @@ from .permissions import (
|
|||||||
permission_document_version_signature_delete,
|
permission_document_version_signature_delete,
|
||||||
permission_document_version_signature_download,
|
permission_document_version_signature_download,
|
||||||
permission_document_version_signature_upload,
|
permission_document_version_signature_upload,
|
||||||
permission_document_version_signature_view,
|
permission_document_version_signature_view
|
||||||
)
|
)
|
||||||
from .queues import * # NOQA
|
from .queues import * # NOQA
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from .tasks import (
|
from .tasks import (
|
||||||
task_unverify_key_signatures, task_verify_missing_embedded_signature,
|
task_unverify_key_signatures, task_verify_key_signatures,
|
||||||
task_verify_key_signatures
|
task_verify_missing_embedded_signature
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
|
||||||
from django.core.files.storage import FileSystemStorage
|
from django.core.files.storage import FileSystemStorage
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
import mayan.apps.document_signatures.models
|
import mayan.apps.document_signatures.models
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
|
||||||
from django.core.files.storage import FileSystemStorage
|
from django.core.files.storage import FileSystemStorage
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
import mayan.apps.document_signatures.models
|
import mayan.apps.document_signatures.models
|
||||||
|
|
||||||
@@ -26,9 +25,9 @@ class Migration(migrations.Migration):
|
|||||||
model_name='documentversionsignature',
|
model_name='documentversionsignature',
|
||||||
name='signature_file',
|
name='signature_file',
|
||||||
field=models.FileField(
|
field=models.FileField(
|
||||||
storage=FileSystemStorage(),
|
blank=True, null=True, storage=FileSystemStorage(),
|
||||||
upload_to=mayan.apps.document_signatures.models.upload_to, null=True,
|
upload_to=mayan.apps.document_signatures.models.upload_to,
|
||||||
verbose_name='Signature file', blank=True
|
verbose_name='Signature file',
|
||||||
),
|
),
|
||||||
preserve_default=True,
|
preserve_default=True,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
from django.core.files.storage import FileSystemStorage
|
from django.core.files.storage import FileSystemStorage
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
import mayan.apps.document_signatures.models
|
import mayan.apps.document_signatures.models
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
@@ -15,8 +14,8 @@ class Migration(migrations.Migration):
|
|||||||
model_name='signaturebasemodel',
|
model_name='signaturebasemodel',
|
||||||
name='public_key_fingerprint',
|
name='public_key_fingerprint',
|
||||||
field=models.CharField(
|
field=models.CharField(
|
||||||
verbose_name='Public key fingerprint', max_length=40,
|
blank=True, editable=False, max_length=40,
|
||||||
null=True, editable=False, blank=True
|
null=True, verbose_name='Public key fingerprint'
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -4,18 +4,19 @@ from django.core.files import File
|
|||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
|
|
||||||
from mayan.apps.documents.tests import (
|
from mayan.apps.documents.tests import (
|
||||||
GenericDocumentViewTestCase, TEST_DOCUMENT_PATH
|
TEST_DOCUMENT_PATH, GenericDocumentViewTestCase
|
||||||
)
|
)
|
||||||
|
|
||||||
from ..links import (
|
from ..links import (
|
||||||
link_document_version_signature_delete,
|
link_document_version_signature_delete,
|
||||||
link_document_version_signature_details,
|
link_document_version_signature_details
|
||||||
)
|
)
|
||||||
from ..models import DetachedSignature
|
from ..models import DetachedSignature
|
||||||
from ..permissions import (
|
from ..permissions import (
|
||||||
permission_document_version_signature_delete,
|
permission_document_version_signature_delete,
|
||||||
permission_document_version_signature_view
|
permission_document_version_signature_view
|
||||||
)
|
)
|
||||||
|
|
||||||
from .literals import TEST_SIGNATURE_FILE_PATH, TEST_SIGNED_DOCUMENT_PATH
|
from .literals import TEST_SIGNATURE_FILE_PATH, TEST_SIGNED_DOCUMENT_PATH
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -13,14 +13,16 @@ from mayan.apps.django_gpg.tests.literals import (
|
|||||||
TEST_KEY_DATA, TEST_KEY_PASSPHRASE
|
TEST_KEY_DATA, TEST_KEY_PASSPHRASE
|
||||||
)
|
)
|
||||||
from mayan.apps.documents.models import DocumentType, DocumentVersion
|
from mayan.apps.documents.models import DocumentType, DocumentVersion
|
||||||
from mayan.apps.documents.tests import TEST_DOCUMENT_PATH, TEST_DOCUMENT_TYPE_LABEL
|
from mayan.apps.documents.tests import (
|
||||||
|
TEST_DOCUMENT_PATH, TEST_DOCUMENT_TYPE_LABEL
|
||||||
|
)
|
||||||
|
|
||||||
from ..models import DetachedSignature, EmbeddedSignature
|
from ..models import DetachedSignature, EmbeddedSignature
|
||||||
from ..tasks import task_verify_missing_embedded_signature
|
from ..tasks import task_verify_missing_embedded_signature
|
||||||
|
|
||||||
from .literals import (
|
from .literals import (
|
||||||
TEST_SIGNED_DOCUMENT_PATH, TEST_SIGNATURE_FILE_PATH, TEST_KEY_FILE,
|
TEST_KEY_FILE, TEST_KEY_ID, TEST_SIGNATURE_FILE_PATH, TEST_SIGNATURE_ID,
|
||||||
TEST_KEY_ID, TEST_SIGNATURE_ID
|
TEST_SIGNED_DOCUMENT_PATH
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ from django_downloadview.test import assert_download_response
|
|||||||
from mayan.apps.django_gpg.models import Key
|
from mayan.apps.django_gpg.models import Key
|
||||||
from mayan.apps.documents.models import DocumentVersion
|
from mayan.apps.documents.models import DocumentVersion
|
||||||
from mayan.apps.documents.tests import (
|
from mayan.apps.documents.tests import (
|
||||||
GenericDocumentViewTestCase, TEST_DOCUMENT_PATH
|
TEST_DOCUMENT_PATH, GenericDocumentViewTestCase
|
||||||
)
|
)
|
||||||
|
|
||||||
from ..models import DetachedSignature, EmbeddedSignature
|
from ..models import DetachedSignature, EmbeddedSignature
|
||||||
@@ -22,7 +22,7 @@ from ..permissions import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
from .literals import (
|
from .literals import (
|
||||||
TEST_SIGNATURE_FILE_PATH, TEST_SIGNED_DOCUMENT_PATH, TEST_KEY_FILE
|
TEST_KEY_FILE, TEST_SIGNATURE_FILE_PATH, TEST_SIGNED_DOCUMENT_PATH
|
||||||
)
|
)
|
||||||
|
|
||||||
TEST_UNSIGNED_DOCUMENT_COUNT = 4
|
TEST_UNSIGNED_DOCUMENT_COUNT = 4
|
||||||
|
|||||||
@@ -22,8 +22,7 @@ from mayan.apps.django_gpg.permissions import permission_key_sign
|
|||||||
from mayan.apps.documents.models import DocumentVersion
|
from mayan.apps.documents.models import DocumentVersion
|
||||||
|
|
||||||
from .forms import (
|
from .forms import (
|
||||||
DocumentVersionSignatureCreateForm,
|
DocumentVersionSignatureCreateForm, DocumentVersionSignatureDetailForm
|
||||||
DocumentVersionSignatureDetailForm
|
|
||||||
)
|
)
|
||||||
from .icons import icon_document_signature_list
|
from .icons import icon_document_signature_list
|
||||||
from .links import (
|
from .links import (
|
||||||
@@ -39,7 +38,7 @@ from .permissions import (
|
|||||||
permission_document_version_signature_download,
|
permission_document_version_signature_download,
|
||||||
permission_document_version_signature_upload,
|
permission_document_version_signature_upload,
|
||||||
permission_document_version_signature_verify,
|
permission_document_version_signature_verify,
|
||||||
permission_document_version_signature_view,
|
permission_document_version_signature_view
|
||||||
)
|
)
|
||||||
from .tasks import task_verify_missing_embedded_signature
|
from .tasks import task_verify_missing_embedded_signature
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ from .permissions import (
|
|||||||
)
|
)
|
||||||
from .serializers import (
|
from .serializers import (
|
||||||
NewWorkflowDocumentTypeSerializer, WorkflowDocumentTypeSerializer,
|
NewWorkflowDocumentTypeSerializer, WorkflowDocumentTypeSerializer,
|
||||||
WorkflowInstanceSerializer, WorkflowInstanceLogEntrySerializer,
|
WorkflowInstanceLogEntrySerializer, WorkflowInstanceSerializer,
|
||||||
WorkflowSerializer, WorkflowStateSerializer, WorkflowTransitionSerializer,
|
WorkflowSerializer, WorkflowStateSerializer, WorkflowTransitionSerializer,
|
||||||
WritableWorkflowInstanceLogEntrySerializer, WritableWorkflowSerializer,
|
WritableWorkflowInstanceLogEntrySerializer, WritableWorkflowSerializer,
|
||||||
WritableWorkflowTransitionSerializer
|
WritableWorkflowTransitionSerializer
|
||||||
|
|||||||
@@ -24,22 +24,23 @@ from .handlers import (
|
|||||||
handler_index_document, handler_trigger_transition, launch_workflow
|
handler_index_document, handler_trigger_transition, launch_workflow
|
||||||
)
|
)
|
||||||
from .links import (
|
from .links import (
|
||||||
link_document_workflow_instance_list, link_setup_workflow_document_types,
|
link_document_workflow_instance_list, link_setup_workflow_create,
|
||||||
link_setup_workflow_create, link_setup_workflow_delete,
|
link_setup_workflow_delete, link_setup_workflow_document_types,
|
||||||
link_setup_workflow_edit, link_setup_workflow_list,
|
link_setup_workflow_edit, link_setup_workflow_list,
|
||||||
link_setup_workflow_states, link_setup_workflow_state_action_delete,
|
link_setup_workflow_state_action_delete,
|
||||||
link_setup_workflow_state_action_edit,
|
link_setup_workflow_state_action_edit,
|
||||||
link_setup_workflow_state_action_list,
|
link_setup_workflow_state_action_list,
|
||||||
link_setup_workflow_state_action_selection,
|
link_setup_workflow_state_action_selection,
|
||||||
link_setup_workflow_state_create, link_setup_workflow_state_delete,
|
link_setup_workflow_state_create, link_setup_workflow_state_delete,
|
||||||
link_setup_workflow_state_edit, link_setup_workflow_transitions,
|
link_setup_workflow_state_edit, link_setup_workflow_states,
|
||||||
link_setup_workflow_transition_create,
|
link_setup_workflow_transition_create,
|
||||||
link_setup_workflow_transition_delete, link_setup_workflow_transition_edit,
|
link_setup_workflow_transition_delete, link_setup_workflow_transition_edit,
|
||||||
link_tool_launch_all_workflows, link_workflow_instance_detail,
|
link_setup_workflow_transitions, link_tool_launch_all_workflows,
|
||||||
link_workflow_instance_transition, link_workflow_document_list,
|
link_workflow_document_list, link_workflow_instance_detail,
|
||||||
link_workflow_list, link_workflow_preview,
|
link_workflow_instance_transition,
|
||||||
link_workflow_state_document_list, link_workflow_state_list,
|
link_workflow_instance_transition_events, link_workflow_list,
|
||||||
link_workflow_instance_transition_events
|
link_workflow_preview, link_workflow_state_document_list,
|
||||||
|
link_workflow_state_list
|
||||||
)
|
)
|
||||||
from .permissions import (
|
from .permissions import (
|
||||||
permission_workflow_delete, permission_workflow_edit,
|
permission_workflow_delete, permission_workflow_edit,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from importlib import import_module
|
|
||||||
import logging
|
import logging
|
||||||
|
from importlib import import_module
|
||||||
|
|
||||||
from django.apps import apps
|
from django.apps import apps
|
||||||
from django.utils import six
|
from django.utils import six
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ from .icons import (
|
|||||||
from .permissions import (
|
from .permissions import (
|
||||||
permission_workflow_create, permission_workflow_delete,
|
permission_workflow_create, permission_workflow_delete,
|
||||||
permission_workflow_edit, permission_workflow_tools,
|
permission_workflow_edit, permission_workflow_tools,
|
||||||
permission_workflow_view,
|
permission_workflow_view
|
||||||
)
|
)
|
||||||
|
|
||||||
link_document_workflow_instance_list = Link(
|
link_document_workflow_instance_list = Link(
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
@@ -15,10 +14,10 @@ class Migration(migrations.Migration):
|
|||||||
model_name='workflowstate',
|
model_name='workflowstate',
|
||||||
name='completion',
|
name='completion',
|
||||||
field=models.IntegerField(
|
field=models.IntegerField(
|
||||||
default=0, help_text='Enter the percent of completion that '
|
blank=True, default=0, help_text='Enter the percent of '
|
||||||
'this state represents in relation to the workflow. Use '
|
'completion that this state represents in relation to the '
|
||||||
'numbers without the percent sign.', verbose_name='Completion',
|
'workflow. Use numbers without the percent sign.',
|
||||||
blank=True
|
verbose_name='Completion',
|
||||||
),
|
),
|
||||||
preserve_default=True,
|
preserve_default=True,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.10.5 on 2017-03-25 04:47
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.10.7 on 2017-06-03 18:26
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.10.7 on 2017-08-03 06:38
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
import django.db.models.deletion
|
import django.db.models.deletion
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
@@ -17,8 +15,19 @@ class Migration(migrations.Migration):
|
|||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name='WorkflowTransitionTriggerEvent',
|
name='WorkflowTransitionTriggerEvent',
|
||||||
fields=[
|
fields=[
|
||||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
(
|
||||||
('stored_event_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='trigger_events', to='events.EventType', verbose_name='Event type')),
|
'id', models.AutoField(
|
||||||
|
auto_created=True, primary_key=True, serialize=False,
|
||||||
|
verbose_name='ID'
|
||||||
|
)
|
||||||
|
),
|
||||||
|
(
|
||||||
|
'stored_event_type', models.ForeignKey(
|
||||||
|
on_delete=django.db.models.deletion.CASCADE,
|
||||||
|
related_name='trigger_events', to='events.EventType',
|
||||||
|
verbose_name='Event type'
|
||||||
|
)
|
||||||
|
),
|
||||||
],
|
],
|
||||||
options={
|
options={
|
||||||
'verbose_name': 'Workflow transition trigger event',
|
'verbose_name': 'Workflow transition trigger event',
|
||||||
@@ -28,16 +37,29 @@ class Migration(migrations.Migration):
|
|||||||
migrations.AddField(
|
migrations.AddField(
|
||||||
model_name='workflowtransition',
|
model_name='workflowtransition',
|
||||||
name='trigger_time_period',
|
name='trigger_time_period',
|
||||||
field=models.PositiveIntegerField(blank=True, help_text='Amount of time after which this transition will trigger on its own.', null=True, verbose_name='Trigger time period'),
|
field=models.PositiveIntegerField(
|
||||||
|
blank=True, help_text='Amount of time after which this '
|
||||||
|
'transition will trigger on its own.', null=True,
|
||||||
|
verbose_name='Trigger time period'
|
||||||
|
),
|
||||||
),
|
),
|
||||||
migrations.AddField(
|
migrations.AddField(
|
||||||
model_name='workflowtransition',
|
model_name='workflowtransition',
|
||||||
name='trigger_time_unit',
|
name='trigger_time_unit',
|
||||||
field=models.CharField(blank=True, choices=[('days', 'Days'), ('hours', 'Hours'), ('minutes', 'Minutes')], max_length=8, null=True, verbose_name='Trigger time unit'),
|
field=models.CharField(
|
||||||
|
blank=True, choices=[
|
||||||
|
('days', 'Days'), ('hours', 'Hours'),
|
||||||
|
('minutes', 'Minutes')
|
||||||
|
], max_length=8, null=True, verbose_name='Trigger time unit'
|
||||||
|
),
|
||||||
),
|
),
|
||||||
migrations.AddField(
|
migrations.AddField(
|
||||||
model_name='workflowtransitiontriggerevent',
|
model_name='workflowtransitiontriggerevent',
|
||||||
name='transition',
|
name='transition',
|
||||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='document_states.WorkflowTransition', verbose_name='Transition'),
|
field=models.ForeignKey(
|
||||||
|
on_delete=django.db.models.deletion.CASCADE,
|
||||||
|
to='document_states.WorkflowTransition',
|
||||||
|
verbose_name='Transition'
|
||||||
|
),
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.10.7 on 2017-08-03 06:51
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.10.7 on 2017-08-03 07:28
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
import django.db.models.deletion
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
import django.db.models.deletion
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
@@ -17,16 +15,28 @@ class Migration(migrations.Migration):
|
|||||||
migrations.AlterField(
|
migrations.AlterField(
|
||||||
model_name='workflowinstancelogentry',
|
model_name='workflowinstancelogentry',
|
||||||
name='user',
|
name='user',
|
||||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='User'),
|
field=models.ForeignKey(
|
||||||
|
blank=True, null=True,
|
||||||
|
on_delete=django.db.models.deletion.CASCADE,
|
||||||
|
to=settings.AUTH_USER_MODEL, verbose_name='User'
|
||||||
|
),
|
||||||
),
|
),
|
||||||
migrations.AlterField(
|
migrations.AlterField(
|
||||||
model_name='workflowtransitiontriggerevent',
|
model_name='workflowtransitiontriggerevent',
|
||||||
name='event_type',
|
name='event_type',
|
||||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='events.EventType', verbose_name='Event type'),
|
field=models.ForeignKey(
|
||||||
|
on_delete=django.db.models.deletion.CASCADE,
|
||||||
|
to='events.EventType', verbose_name='Event type'
|
||||||
|
),
|
||||||
),
|
),
|
||||||
migrations.AlterField(
|
migrations.AlterField(
|
||||||
model_name='workflowtransitiontriggerevent',
|
model_name='workflowtransitiontriggerevent',
|
||||||
name='transition',
|
name='transition',
|
||||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='trigger_events', to='document_states.WorkflowTransition', verbose_name='Transition'),
|
field=models.ForeignKey(
|
||||||
|
on_delete=django.db.models.deletion.CASCADE,
|
||||||
|
related_name='trigger_events',
|
||||||
|
to='document_states.WorkflowTransition',
|
||||||
|
verbose_name='Transition'
|
||||||
|
),
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.10.7 on 2017-08-03 07:52
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.10.7 on 2017-08-07 06:12
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
|
||||||
import django.db.models.deletion
|
import django.db.models.deletion
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
@@ -16,13 +14,49 @@ class Migration(migrations.Migration):
|
|||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name='WorkflowStateAction',
|
name='WorkflowStateAction',
|
||||||
fields=[
|
fields=[
|
||||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
(
|
||||||
('label', models.CharField(max_length=255, verbose_name='Label')),
|
'id', models.AutoField(
|
||||||
('enabled', models.BooleanField(default=True, verbose_name='Enabled')),
|
auto_created=True, primary_key=True, serialize=False,
|
||||||
('when', models.PositiveIntegerField(choices=[(1, 'On entry'), (2, 'On exit')], default=1, help_text='At which moment of the state this action will execute', verbose_name='When')),
|
verbose_name='ID'
|
||||||
('action_path', models.CharField(help_text='The dotted Python path to the workflow action class to execute.', max_length=128, verbose_name='Entry action path')),
|
)
|
||||||
('action_data', models.TextField(blank=True, verbose_name='Entry action data')),
|
),
|
||||||
('state', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='actions', to='document_states.WorkflowState', verbose_name='Workflow state')),
|
(
|
||||||
|
'label', models.CharField(
|
||||||
|
max_length=255, verbose_name='Label'
|
||||||
|
)
|
||||||
|
),
|
||||||
|
(
|
||||||
|
'enabled', models.BooleanField(
|
||||||
|
default=True, verbose_name='Enabled'
|
||||||
|
)
|
||||||
|
),
|
||||||
|
(
|
||||||
|
'when', models.PositiveIntegerField(
|
||||||
|
choices=[(1, 'On entry'), (2, 'On exit')], default=1,
|
||||||
|
help_text='At which moment of the state this action '
|
||||||
|
'will execute', verbose_name='When'
|
||||||
|
)
|
||||||
|
),
|
||||||
|
(
|
||||||
|
'action_path', models.CharField(
|
||||||
|
help_text='The dotted Python path to the workflow '
|
||||||
|
'action class to execute.', max_length=128,
|
||||||
|
verbose_name='Entry action path'
|
||||||
|
)
|
||||||
|
),
|
||||||
|
(
|
||||||
|
'action_data', models.TextField(
|
||||||
|
blank=True, verbose_name='Entry action data'
|
||||||
|
)
|
||||||
|
),
|
||||||
|
(
|
||||||
|
'state', models.ForeignKey(
|
||||||
|
on_delete=django.db.models.deletion.CASCADE,
|
||||||
|
related_name='actions',
|
||||||
|
to='document_states.WorkflowState',
|
||||||
|
verbose_name='Workflow state'
|
||||||
|
)
|
||||||
|
),
|
||||||
],
|
],
|
||||||
options={
|
options={
|
||||||
'ordering': ('label',),
|
'ordering': ('label',),
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.11.10 on 2018-03-10 17:17
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
@@ -14,6 +12,10 @@ class Migration(migrations.Migration):
|
|||||||
operations = [
|
operations = [
|
||||||
migrations.AlterModelOptions(
|
migrations.AlterModelOptions(
|
||||||
name='workflowinstancelogentry',
|
name='workflowinstancelogentry',
|
||||||
options={'ordering': ('datetime',), 'verbose_name': 'Workflow instance log entry', 'verbose_name_plural': 'Workflow instance log entries'},
|
options={
|
||||||
|
'ordering': ('datetime',),
|
||||||
|
'verbose_name': 'Workflow instance log entry',
|
||||||
|
'verbose_name_plural': 'Workflow instance log entries'
|
||||||
|
},
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.11.10 on 2018-03-15 00:29
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
@@ -14,6 +12,9 @@ class Migration(migrations.Migration):
|
|||||||
operations = [
|
operations = [
|
||||||
migrations.AlterModelOptions(
|
migrations.AlterModelOptions(
|
||||||
name='workflowinstance',
|
name='workflowinstance',
|
||||||
options={'ordering': ('workflow',), 'verbose_name': 'Workflow instance', 'verbose_name_plural': 'Workflow instances'},
|
options={
|
||||||
|
'ordering': ('workflow',), 'verbose_name': 'Workflow instance',
|
||||||
|
'verbose_name_plural': 'Workflow instances'
|
||||||
|
},
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.11.11 on 2018-08-23 23:53
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
@@ -15,6 +13,9 @@ class Migration(migrations.Migration):
|
|||||||
migrations.AlterField(
|
migrations.AlterField(
|
||||||
model_name='workflowstateaction',
|
model_name='workflowstateaction',
|
||||||
name='label',
|
name='label',
|
||||||
field=models.CharField(help_text='A simple identifier for this action.', max_length=255, verbose_name='Label'),
|
field=models.CharField(
|
||||||
|
help_text='A simple identifier for this action.',
|
||||||
|
max_length=255, verbose_name='Label'
|
||||||
|
),
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ from graphviz import Digraph
|
|||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.core import serializers
|
from django.core import serializers
|
||||||
from django.core.files.base import ContentFile
|
|
||||||
from django.core.exceptions import PermissionDenied, ValidationError
|
from django.core.exceptions import PermissionDenied, ValidationError
|
||||||
|
from django.core.files.base import ContentFile
|
||||||
from django.db import IntegrityError, models
|
from django.db import IntegrityError, models
|
||||||
from django.db.models import F, Max, Q
|
from django.db.models import F, Max, Q
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
@@ -25,8 +25,8 @@ from mayan.apps.events.models import StoredEventType
|
|||||||
|
|
||||||
from .error_logs import error_log_state_actions
|
from .error_logs import error_log_state_actions
|
||||||
from .literals import (
|
from .literals import (
|
||||||
WORKFLOW_ACTION_WHEN_CHOICES, WORKFLOW_ACTION_ON_ENTRY,
|
WORKFLOW_ACTION_ON_ENTRY, WORKFLOW_ACTION_ON_EXIT,
|
||||||
WORKFLOW_ACTION_ON_EXIT
|
WORKFLOW_ACTION_WHEN_CHOICES
|
||||||
)
|
)
|
||||||
from .managers import WorkflowManager
|
from .managers import WorkflowManager
|
||||||
from .permissions import permission_workflow_transition
|
from .permissions import permission_workflow_transition
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ from django.utils.translation import ugettext_lazy as _
|
|||||||
|
|
||||||
from mayan.apps.task_manager.classes import CeleryQueue
|
from mayan.apps.task_manager.classes import CeleryQueue
|
||||||
|
|
||||||
|
|
||||||
queue_document_states = CeleryQueue(
|
queue_document_states = CeleryQueue(
|
||||||
name='document_states', label=_('Document states')
|
name='document_states', label=_('Document states')
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ from __future__ import unicode_literals
|
|||||||
from ..models import Workflow, WorkflowState, WorkflowTransition
|
from ..models import Workflow, WorkflowState, WorkflowTransition
|
||||||
|
|
||||||
from .literals import (
|
from .literals import (
|
||||||
TEST_WORKFLOW_INITIAL_STATE_LABEL, TEST_WORKFLOW_INITIAL_STATE_COMPLETION,
|
TEST_WORKFLOW_INITIAL_STATE_COMPLETION, TEST_WORKFLOW_INITIAL_STATE_LABEL,
|
||||||
TEST_WORKFLOW_INTERNAL_NAME, TEST_WORKFLOW_LABEL,
|
TEST_WORKFLOW_INTERNAL_NAME, TEST_WORKFLOW_LABEL,
|
||||||
TEST_WORKFLOW_STATE_LABEL, TEST_WORKFLOW_STATE_COMPLETION,
|
TEST_WORKFLOW_STATE_COMPLETION, TEST_WORKFLOW_STATE_LABEL,
|
||||||
TEST_WORKFLOW_TRANSITION_LABEL, TEST_WORKFLOW_TRANSITION_LABEL_2
|
TEST_WORKFLOW_TRANSITION_LABEL, TEST_WORKFLOW_TRANSITION_LABEL_2
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -19,12 +19,12 @@ from ..permissions import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
from .literals import (
|
from .literals import (
|
||||||
TEST_WORKFLOW_INTERNAL_NAME, TEST_WORKFLOW_INITIAL_STATE_COMPLETION,
|
TEST_WORKFLOW_INITIAL_STATE_COMPLETION, TEST_WORKFLOW_INITIAL_STATE_LABEL,
|
||||||
TEST_WORKFLOW_INITIAL_STATE_LABEL,
|
TEST_WORKFLOW_INSTANCE_LOG_ENTRY_COMMENT, TEST_WORKFLOW_INTERNAL_NAME,
|
||||||
TEST_WORKFLOW_INSTANCE_LOG_ENTRY_COMMENT, TEST_WORKFLOW_LABEL,
|
TEST_WORKFLOW_LABEL, TEST_WORKFLOW_LABEL_EDITED,
|
||||||
TEST_WORKFLOW_LABEL_EDITED, TEST_WORKFLOW_STATE_COMPLETION,
|
TEST_WORKFLOW_STATE_COMPLETION, TEST_WORKFLOW_STATE_LABEL,
|
||||||
TEST_WORKFLOW_STATE_LABEL, TEST_WORKFLOW_STATE_LABEL_EDITED,
|
TEST_WORKFLOW_STATE_LABEL_EDITED, TEST_WORKFLOW_TRANSITION_LABEL,
|
||||||
TEST_WORKFLOW_TRANSITION_LABEL, TEST_WORKFLOW_TRANSITION_LABEL_EDITED
|
TEST_WORKFLOW_TRANSITION_LABEL_EDITED
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,19 +3,19 @@ from __future__ import unicode_literals
|
|||||||
from django.test import override_settings
|
from django.test import override_settings
|
||||||
|
|
||||||
from mayan.apps.common.tests import BaseTestCase
|
from mayan.apps.common.tests import BaseTestCase
|
||||||
|
from mayan.apps.document_indexing.models import Index, IndexInstanceNode
|
||||||
from mayan.apps.documents.models import DocumentType
|
from mayan.apps.documents.models import DocumentType
|
||||||
from mayan.apps.documents.tests import (
|
from mayan.apps.documents.tests import (
|
||||||
TEST_SMALL_DOCUMENT_PATH, TEST_DOCUMENT_TYPE_LABEL
|
TEST_DOCUMENT_TYPE_LABEL, TEST_SMALL_DOCUMENT_PATH
|
||||||
)
|
)
|
||||||
from mayan.apps.document_indexing.models import Index, IndexInstanceNode
|
|
||||||
|
|
||||||
from ..models import Workflow
|
from ..models import Workflow
|
||||||
|
|
||||||
from .literals import (
|
from .literals import (
|
||||||
TEST_INDEX_LABEL, TEST_INDEX_TEMPLATE_METADATA_EXPRESSION,
|
TEST_INDEX_LABEL, TEST_INDEX_TEMPLATE_METADATA_EXPRESSION,
|
||||||
TEST_WORKFLOW_INTERNAL_NAME, TEST_WORKFLOW_INITIAL_STATE_LABEL,
|
TEST_WORKFLOW_INITIAL_STATE_COMPLETION, TEST_WORKFLOW_INITIAL_STATE_LABEL,
|
||||||
TEST_WORKFLOW_INITIAL_STATE_COMPLETION, TEST_WORKFLOW_LABEL,
|
TEST_WORKFLOW_INTERNAL_NAME, TEST_WORKFLOW_LABEL,
|
||||||
TEST_WORKFLOW_STATE_LABEL, TEST_WORKFLOW_STATE_COMPLETION,
|
TEST_WORKFLOW_STATE_COMPLETION, TEST_WORKFLOW_STATE_LABEL,
|
||||||
TEST_WORKFLOW_TRANSITION_LABEL
|
TEST_WORKFLOW_TRANSITION_LABEL
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -2,22 +2,22 @@ from __future__ import unicode_literals
|
|||||||
|
|
||||||
from mayan.apps.common.tests import GenericViewTestCase
|
from mayan.apps.common.tests import GenericViewTestCase
|
||||||
from mayan.apps.documents.tests import (
|
from mayan.apps.documents.tests import (
|
||||||
GenericDocumentViewTestCase, TEST_SMALL_DOCUMENT_PATH
|
TEST_SMALL_DOCUMENT_PATH, GenericDocumentViewTestCase
|
||||||
)
|
)
|
||||||
|
|
||||||
from ..models import Workflow, WorkflowState, WorkflowTransition
|
from ..models import Workflow, WorkflowState, WorkflowTransition
|
||||||
from ..permissions import (
|
from ..permissions import (
|
||||||
permission_workflow_create, permission_workflow_delete,
|
permission_workflow_create, permission_workflow_delete,
|
||||||
permission_workflow_edit, permission_workflow_view,
|
permission_workflow_edit, permission_workflow_tools,
|
||||||
permission_workflow_tools, permission_workflow_transition
|
permission_workflow_transition, permission_workflow_view
|
||||||
)
|
)
|
||||||
|
|
||||||
from .literals import (
|
from .literals import (
|
||||||
TEST_WORKFLOW_INITIAL_STATE_LABEL, TEST_WORKFLOW_INITIAL_STATE_COMPLETION,
|
TEST_WORKFLOW_INITIAL_STATE_COMPLETION, TEST_WORKFLOW_INITIAL_STATE_LABEL,
|
||||||
TEST_WORKFLOW_INTERNAL_NAME, TEST_WORKFLOW_LABEL,
|
TEST_WORKFLOW_INTERNAL_NAME, TEST_WORKFLOW_LABEL,
|
||||||
TEST_WORKFLOW_LABEL_EDITED, TEST_WORKFLOW_STATE_LABEL,
|
TEST_WORKFLOW_LABEL_EDITED, TEST_WORKFLOW_STATE_COMPLETION,
|
||||||
TEST_WORKFLOW_STATE_LABEL_EDITED, TEST_WORKFLOW_STATE_COMPLETION,
|
TEST_WORKFLOW_STATE_LABEL, TEST_WORKFLOW_STATE_LABEL_EDITED,
|
||||||
TEST_WORKFLOW_TRANSITION_LABEL, TEST_WORKFLOW_TRANSITION_LABEL_EDITED,
|
TEST_WORKFLOW_TRANSITION_LABEL, TEST_WORKFLOW_TRANSITION_LABEL_EDITED
|
||||||
)
|
)
|
||||||
from .mixins import WorkflowTestMixin
|
from .mixins import WorkflowTestMixin
|
||||||
|
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ from django.conf.urls import url
|
|||||||
from .api_views import (
|
from .api_views import (
|
||||||
APIDocumentTypeWorkflowListView, APIWorkflowDocumentTypeList,
|
APIDocumentTypeWorkflowListView, APIWorkflowDocumentTypeList,
|
||||||
APIWorkflowDocumentTypeView, APIWorkflowImageView,
|
APIWorkflowDocumentTypeView, APIWorkflowImageView,
|
||||||
APIWorkflowInstanceListView, APIWorkflowInstanceView,
|
APIWorkflowInstanceListView, APIWorkflowInstanceLogEntryListView,
|
||||||
APIWorkflowInstanceLogEntryListView, APIWorkflowListView,
|
APIWorkflowInstanceView, APIWorkflowListView, APIWorkflowStateListView,
|
||||||
APIWorkflowStateListView, APIWorkflowStateView,
|
APIWorkflowStateView, APIWorkflowTransitionListView,
|
||||||
APIWorkflowTransitionListView, APIWorkflowTransitionView, APIWorkflowView
|
APIWorkflowTransitionView, APIWorkflowView
|
||||||
)
|
)
|
||||||
from .views import (
|
from .views import (
|
||||||
DocumentWorkflowInstanceListView, SetupWorkflowCreateView,
|
DocumentWorkflowInstanceListView, SetupWorkflowCreateView,
|
||||||
@@ -18,13 +18,13 @@ from .views import (
|
|||||||
SetupWorkflowStateActionEditView, SetupWorkflowStateActionListView,
|
SetupWorkflowStateActionEditView, SetupWorkflowStateActionListView,
|
||||||
SetupWorkflowStateActionSelectionView, SetupWorkflowStateCreateView,
|
SetupWorkflowStateActionSelectionView, SetupWorkflowStateCreateView,
|
||||||
SetupWorkflowStateDeleteView, SetupWorkflowStateEditView,
|
SetupWorkflowStateDeleteView, SetupWorkflowStateEditView,
|
||||||
SetupWorkflowStateListView, SetupWorkflowTransitionListView,
|
SetupWorkflowStateListView, SetupWorkflowTransitionCreateView,
|
||||||
SetupWorkflowTransitionCreateView, SetupWorkflowTransitionDeleteView,
|
SetupWorkflowTransitionDeleteView, SetupWorkflowTransitionEditView,
|
||||||
SetupWorkflowTransitionEditView,
|
SetupWorkflowTransitionListView,
|
||||||
SetupWorkflowTransitionTriggerEventListView, ToolLaunchAllWorkflows,
|
SetupWorkflowTransitionTriggerEventListView, ToolLaunchAllWorkflows,
|
||||||
WorkflowDocumentListView, WorkflowInstanceDetailView,
|
WorkflowDocumentListView, WorkflowInstanceDetailView,
|
||||||
WorkflowInstanceTransitionView, WorkflowListView, WorkflowPreviewView,
|
WorkflowInstanceTransitionView, WorkflowListView, WorkflowPreviewView,
|
||||||
WorkflowStateDocumentListView, WorkflowStateListView,
|
WorkflowStateDocumentListView, WorkflowStateListView
|
||||||
)
|
)
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
|
|||||||
@@ -32,18 +32,17 @@ from .icons import (
|
|||||||
icon_workflow_transition
|
icon_workflow_transition
|
||||||
)
|
)
|
||||||
from .links import (
|
from .links import (
|
||||||
link_setup_workflow_create, link_setup_workflow_state_create,
|
link_setup_workflow_create, link_setup_workflow_state_action_selection,
|
||||||
link_setup_workflow_state_action_selection,
|
link_setup_workflow_state_create, link_setup_workflow_transition_create
|
||||||
link_setup_workflow_transition_create
|
|
||||||
)
|
)
|
||||||
from .models import (
|
from .models import (
|
||||||
Workflow, WorkflowInstance, WorkflowState, WorkflowStateAction,
|
Workflow, WorkflowInstance, WorkflowRuntimeProxy, WorkflowState,
|
||||||
WorkflowTransition, WorkflowRuntimeProxy, WorkflowStateRuntimeProxy,
|
WorkflowStateAction, WorkflowStateRuntimeProxy, WorkflowTransition
|
||||||
)
|
)
|
||||||
from .permissions import (
|
from .permissions import (
|
||||||
permission_workflow_create, permission_workflow_delete,
|
permission_workflow_create, permission_workflow_delete,
|
||||||
permission_workflow_edit, permission_workflow_tools,
|
permission_workflow_edit, permission_workflow_tools,
|
||||||
permission_workflow_view,
|
permission_workflow_view
|
||||||
)
|
)
|
||||||
from .tasks import task_launch_all_workflows
|
from .tasks import task_launch_all_workflows
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
from __future__ import absolute_import, unicode_literals
|
from __future__ import absolute_import, unicode_literals
|
||||||
|
|
||||||
import logging
|
|
||||||
import json
|
import json
|
||||||
|
import logging
|
||||||
|
|
||||||
from jinja2 import Template
|
from jinja2 import Template
|
||||||
import requests
|
import requests
|
||||||
|
|||||||
@@ -9,9 +9,8 @@ from django.utils.module_loading import import_string
|
|||||||
from django.utils.translation import ugettext as _
|
from django.utils.translation import ugettext as _
|
||||||
|
|
||||||
from .literals import (
|
from .literals import (
|
||||||
QUERY_OPERATION_AND, QUERY_OPERATION_OR, TERM_OPERATION_OR,
|
QUERY_OPERATION_AND, QUERY_OPERATION_OR, TERM_NEGATION_CHARACTER,
|
||||||
TERM_OPERATIONS, TERM_QUOTES, TERM_NEGATION_CHARACTER,
|
TERM_OPERATION_OR, TERM_OPERATIONS, TERM_QUOTES, TERM_SPACE_CHARACTER
|
||||||
TERM_SPACE_CHARACTER
|
|
||||||
)
|
)
|
||||||
from .settings import setting_limit
|
from .settings import setting_limit
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ from django.utils.translation import ugettext_lazy as _
|
|||||||
|
|
||||||
from mayan.apps.smart_settings import Namespace
|
from mayan.apps.smart_settings import Namespace
|
||||||
|
|
||||||
|
|
||||||
namespace = Namespace(name='dynamic_search', label=_('Search'))
|
namespace = Namespace(name='dynamic_search', label=_('Search'))
|
||||||
setting_limit = namespace.add_setting(
|
setting_limit = namespace.add_setting(
|
||||||
global_name='SEARCH_LIMIT', default=100,
|
global_name='SEARCH_LIMIT', default=100,
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ from django.urls import reverse
|
|||||||
|
|
||||||
from rest_framework import status
|
from rest_framework import status
|
||||||
|
|
||||||
from mayan.apps.documents.search import document_search
|
|
||||||
from mayan.apps.documents.permissions import permission_document_view
|
from mayan.apps.documents.permissions import permission_document_view
|
||||||
|
from mayan.apps.documents.search import document_search
|
||||||
from mayan.apps.documents.tests import DocumentTestMixin
|
from mayan.apps.documents.tests import DocumentTestMixin
|
||||||
from mayan.apps.rest_api.tests import BaseAPITestCase
|
from mayan.apps.rest_api.tests import BaseAPITestCase
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ from django.test import override_settings
|
|||||||
from mayan.apps.common.tests import BaseTestCase
|
from mayan.apps.common.tests import BaseTestCase
|
||||||
from mayan.apps.documents.search import document_search
|
from mayan.apps.documents.search import document_search
|
||||||
from mayan.apps.documents.tests import (
|
from mayan.apps.documents.tests import (
|
||||||
DocumentTestMixin, TEST_DOCUMENT_FILENAME, TEST_SMALL_DOCUMENT_FILENAME
|
TEST_DOCUMENT_FILENAME, TEST_SMALL_DOCUMENT_FILENAME, DocumentTestMixin
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,9 @@ from django.test import override_settings
|
|||||||
from mayan.apps.common.tests import GenericViewTestCase
|
from mayan.apps.common.tests import GenericViewTestCase
|
||||||
from mayan.apps.documents.models import DocumentType
|
from mayan.apps.documents.models import DocumentType
|
||||||
from mayan.apps.documents.search import document_search
|
from mayan.apps.documents.search import document_search
|
||||||
from mayan.apps.documents.tests import TEST_DOCUMENT_TYPE_LABEL, TEST_SMALL_DOCUMENT_PATH
|
from mayan.apps.documents.tests import (
|
||||||
|
TEST_DOCUMENT_TYPE_LABEL, TEST_SMALL_DOCUMENT_PATH
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@override_settings(OCR_AUTO_OCR=False)
|
@override_settings(OCR_AUTO_OCR=False)
|
||||||
|
|||||||
@@ -2,12 +2,8 @@ from __future__ import unicode_literals
|
|||||||
|
|
||||||
from django.conf.urls import url
|
from django.conf.urls import url
|
||||||
|
|
||||||
from .api_views import (
|
from .api_views import APIAdvancedSearchView, APISearchModelList, APISearchView
|
||||||
APIAdvancedSearchView, APISearchModelList, APISearchView
|
from .views import AdvancedSearchView, ResultsView, SearchAgainView, SearchView
|
||||||
)
|
|
||||||
from .views import (
|
|
||||||
AdvancedSearchView, ResultsView, SearchAgainView, SearchView
|
|
||||||
)
|
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
url(r'^(?P<search_model>[\.\w]+)/$', SearchView.as_view(), name='search'),
|
url(r'^(?P<search_model>[\.\w]+)/$', SearchView.as_view(), name='search'),
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ from django.views.generic.base import RedirectView
|
|||||||
|
|
||||||
from mayan.apps.common.generics import SimpleView, SingleObjectListView
|
from mayan.apps.common.generics import SimpleView, SingleObjectListView
|
||||||
|
|
||||||
from .forms import SearchForm, AdvancedSearchForm
|
from .forms import AdvancedSearchForm, SearchForm
|
||||||
from .icons import icon_search_submit
|
from .icons import icon_search_submit
|
||||||
from .mixins import SearchModelMixin
|
from .mixins import SearchModelMixin
|
||||||
from .settings import setting_limit
|
from .settings import setting_limit
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ from .classes import EventType, EventTypeNamespace
|
|||||||
from .models import Notification
|
from .models import Notification
|
||||||
from .permissions import permission_events_view
|
from .permissions import permission_events_view
|
||||||
from .serializers import (
|
from .serializers import (
|
||||||
EventSerializer, EventTypeSerializer, EventTypeNamespaceSerializer,
|
EventSerializer, EventTypeNamespaceSerializer, EventTypeSerializer,
|
||||||
NotificationSerializer
|
NotificationSerializer
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -11,12 +11,12 @@ from mayan.apps.common import (
|
|||||||
from mayan.apps.common.widgets import TwoStateWidget
|
from mayan.apps.common.widgets import TwoStateWidget
|
||||||
from mayan.apps.navigation import SourceColumn
|
from mayan.apps.navigation import SourceColumn
|
||||||
|
|
||||||
from .links import (
|
|
||||||
link_events_list, link_event_types_subscriptions_list,
|
|
||||||
link_notification_mark_read, link_notification_mark_read_all,
|
|
||||||
link_user_events, link_user_notifications_list,
|
|
||||||
)
|
|
||||||
from .licenses import * # NOQA
|
from .licenses import * # NOQA
|
||||||
|
from .links import (
|
||||||
|
link_event_types_subscriptions_list, link_events_list,
|
||||||
|
link_notification_mark_read, link_notification_mark_read_all,
|
||||||
|
link_user_events, link_user_notifications_list
|
||||||
|
)
|
||||||
from .widgets import event_object_link, event_type_link, event_user_link
|
from .widgets import event_object_link, event_type_link, event_user_link
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ from django.utils.translation import ugettext_lazy as _
|
|||||||
from mayan.apps.navigation import Link
|
from mayan.apps.navigation import Link
|
||||||
|
|
||||||
from .icons import (
|
from .icons import (
|
||||||
icon_events_list, icon_events_for_object,
|
icon_event_types_subscriptions_list, icon_events_for_object,
|
||||||
icon_event_types_subscriptions_list,
|
icon_events_list, icon_events_user_list,
|
||||||
icon_events_user_list, icon_object_event_types_user_subcriptions_list,
|
icon_object_event_types_user_subcriptions_list,
|
||||||
icon_user_notifications_list
|
icon_user_notifications_list
|
||||||
)
|
)
|
||||||
from .permissions import permission_events_view
|
from .permissions import permission_events_view
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.10.7 on 2017-07-29 07:04
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
import django.db.models.deletion
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
import django.db.models.deletion
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
@@ -18,9 +16,25 @@ class Migration(migrations.Migration):
|
|||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name='EventSubscription',
|
name='EventSubscription',
|
||||||
fields=[
|
fields=[
|
||||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
(
|
||||||
('event_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='subscriptions', to='events.EventType', verbose_name='Event type')),
|
'id', models.AutoField(
|
||||||
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='User')),
|
auto_created=True, primary_key=True, serialize=False,
|
||||||
|
verbose_name='ID'
|
||||||
|
)
|
||||||
|
),
|
||||||
|
(
|
||||||
|
'event_type', models.ForeignKey(
|
||||||
|
on_delete=django.db.models.deletion.CASCADE,
|
||||||
|
related_name='subscriptions', to='events.EventType',
|
||||||
|
verbose_name='Event type'
|
||||||
|
)
|
||||||
|
),
|
||||||
|
(
|
||||||
|
'user', models.ForeignKey(
|
||||||
|
on_delete=django.db.models.deletion.CASCADE,
|
||||||
|
to=settings.AUTH_USER_MODEL, verbose_name='User'
|
||||||
|
)
|
||||||
|
),
|
||||||
],
|
],
|
||||||
options={
|
options={
|
||||||
'verbose_name': 'Event subscription',
|
'verbose_name': 'Event subscription',
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.10.7 on 2017-07-29 07:23
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
import django.db.models.deletion
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
import django.db.models.deletion
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
@@ -19,10 +17,32 @@ class Migration(migrations.Migration):
|
|||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name='Notification',
|
name='Notification',
|
||||||
fields=[
|
fields=[
|
||||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
(
|
||||||
('read', models.BooleanField(default=False, verbose_name='Read')),
|
'id', models.AutoField(
|
||||||
('action', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='notifications', to='actstream.Action', verbose_name='Action')),
|
auto_created=True, primary_key=True, serialize=False,
|
||||||
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='notifications', to=settings.AUTH_USER_MODEL, verbose_name='User')),
|
verbose_name='ID'
|
||||||
|
)
|
||||||
|
),
|
||||||
|
(
|
||||||
|
'read', models.BooleanField(
|
||||||
|
default=False, verbose_name='Read'
|
||||||
|
)
|
||||||
|
),
|
||||||
|
(
|
||||||
|
'action', models.ForeignKey(
|
||||||
|
on_delete=django.db.models.deletion.CASCADE,
|
||||||
|
related_name='notifications', to='actstream.Action',
|
||||||
|
verbose_name='Action'
|
||||||
|
)
|
||||||
|
),
|
||||||
|
(
|
||||||
|
'user', models.ForeignKey(
|
||||||
|
on_delete=django.db.models.deletion.CASCADE,
|
||||||
|
related_name='notifications',
|
||||||
|
to=settings.AUTH_USER_MODEL,
|
||||||
|
verbose_name='User'
|
||||||
|
)
|
||||||
|
),
|
||||||
],
|
],
|
||||||
options={
|
options={
|
||||||
'verbose_name': 'Notification',
|
'verbose_name': 'Notification',
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.10.7 on 2017-07-31 04:23
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
import django.db.models.deletion
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
import django.db.models.deletion
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
@@ -20,7 +18,10 @@ class Migration(migrations.Migration):
|
|||||||
),
|
),
|
||||||
migrations.AlterModelOptions(
|
migrations.AlterModelOptions(
|
||||||
name='storedeventtype',
|
name='storedeventtype',
|
||||||
options={'verbose_name': 'Stored event type', 'verbose_name_plural': 'Stored event types'},
|
options={
|
||||||
|
'verbose_name': 'Stored event type',
|
||||||
|
'verbose_name_plural': 'Stored event types'
|
||||||
|
},
|
||||||
),
|
),
|
||||||
migrations.RemoveField(
|
migrations.RemoveField(
|
||||||
model_name='eventsubscription',
|
model_name='eventsubscription',
|
||||||
@@ -29,12 +30,20 @@ class Migration(migrations.Migration):
|
|||||||
migrations.AddField(
|
migrations.AddField(
|
||||||
model_name='eventsubscription',
|
model_name='eventsubscription',
|
||||||
name='stored_event_type',
|
name='stored_event_type',
|
||||||
field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, related_name='event_subscriptions', to='events.StoredEventType', verbose_name='Event type'),
|
field=models.ForeignKey(
|
||||||
|
default=1, on_delete=django.db.models.deletion.CASCADE,
|
||||||
|
related_name='event_subscriptions',
|
||||||
|
to='events.StoredEventType', verbose_name='Event type'
|
||||||
|
),
|
||||||
preserve_default=False,
|
preserve_default=False,
|
||||||
),
|
),
|
||||||
migrations.AlterField(
|
migrations.AlterField(
|
||||||
model_name='eventsubscription',
|
model_name='eventsubscription',
|
||||||
name='user',
|
name='user',
|
||||||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='event_subscriptions', to=settings.AUTH_USER_MODEL, verbose_name='User'),
|
field=models.ForeignKey(
|
||||||
|
on_delete=django.db.models.deletion.CASCADE,
|
||||||
|
related_name='event_subscriptions',
|
||||||
|
to=settings.AUTH_USER_MODEL, verbose_name='User'
|
||||||
|
),
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.10.7 on 2017-07-31 06:40
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
import django.db.models.deletion
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
import django.db.models.deletion
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
@@ -19,11 +17,34 @@ class Migration(migrations.Migration):
|
|||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name='ObjectEventSubscription',
|
name='ObjectEventSubscription',
|
||||||
fields=[
|
fields=[
|
||||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
(
|
||||||
|
'id', models.AutoField(
|
||||||
|
auto_created=True, primary_key=True, serialize=False,
|
||||||
|
verbose_name='ID'
|
||||||
|
)
|
||||||
|
),
|
||||||
('object_id', models.PositiveIntegerField()),
|
('object_id', models.PositiveIntegerField()),
|
||||||
('content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType')),
|
(
|
||||||
('stored_event_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='object_subscriptions', to='events.StoredEventType', verbose_name='Event type')),
|
'content_type', models.ForeignKey(
|
||||||
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='object_subscriptions', to=settings.AUTH_USER_MODEL, verbose_name='User')),
|
on_delete=django.db.models.deletion.CASCADE,
|
||||||
|
to='contenttypes.ContentType'
|
||||||
|
)
|
||||||
|
),
|
||||||
|
(
|
||||||
|
'stored_event_type', models.ForeignKey(
|
||||||
|
on_delete=django.db.models.deletion.CASCADE,
|
||||||
|
related_name='object_subscriptions',
|
||||||
|
to='events.StoredEventType',
|
||||||
|
verbose_name='Event type'
|
||||||
|
)
|
||||||
|
),
|
||||||
|
(
|
||||||
|
'user', models.ForeignKey(
|
||||||
|
on_delete=django.db.models.deletion.CASCADE,
|
||||||
|
related_name='object_subscriptions',
|
||||||
|
to=settings.AUTH_USER_MODEL, verbose_name='User'
|
||||||
|
)
|
||||||
|
),
|
||||||
],
|
],
|
||||||
options={
|
options={
|
||||||
'verbose_name': 'Object event subscription',
|
'verbose_name': 'Object event subscription',
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Generated by Django 1.10.7 on 2017-08-02 08:23
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
@@ -14,6 +12,10 @@ class Migration(migrations.Migration):
|
|||||||
operations = [
|
operations = [
|
||||||
migrations.AlterModelOptions(
|
migrations.AlterModelOptions(
|
||||||
name='notification',
|
name='notification',
|
||||||
options={'ordering': ('-action__timestamp',), 'verbose_name': 'Notification', 'verbose_name_plural': 'Notifications'},
|
options={
|
||||||
|
'ordering': ('-action__timestamp',),
|
||||||
|
'verbose_name': 'Notification',
|
||||||
|
'verbose_name_plural': 'Notifications'
|
||||||
|
},
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user