simpledomcontrol 0.56.3__tar.gz → 0.56.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/PKG-INFO +1 -1
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/pyproject.toml +1 -1
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/consumers.py +25 -21
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/sdc_extentions/views.py +13 -1
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/template_files/package.json +1 -1
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/template_files/settings_extension.py.txt +2 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/template_files/templates/base.html +1 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/template_files/urls.py.txt +1 -1
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/README.md +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/__init__.py +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/apps.py +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/management/__init__.py +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/management/commands/__init__.py +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/management/commands/_private.py +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/management/commands/init_add/__init__.py +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/management/commands/init_add/add_controller_manager.py +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/management/commands/init_add/add_model_manager.py +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/management/commands/init_add/options.py +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/management/commands/init_add/sdc_core_manager.py +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/management/commands/init_add/settings_manager.py +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/management/commands/init_add/utils.py +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/management/commands/sdc_cc.py +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/management/commands/sdc_get_controller_infos.py +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/management/commands/sdc_get_controller_url.py +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/management/commands/sdc_get_model_infos.py +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/management/commands/sdc_init.py +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/management/commands/sdc_is_installed.py +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/management/commands/sdc_new_model.py +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/management/commands/sdc_shell_execute_script.py +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/management/commands/sdc_update_links.py +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/management/commands/sdc_update_url.py +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/sdc_extentions/__init__.py +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/sdc_extentions/forms.py +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/sdc_extentions/import_manager.py +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/sdc_extentions/models.py +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/sdc_extentions/response.py +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/sdc_extentions/search.py +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/template_files/Assets/.babelrc +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/template_files/Assets/gulpfile.jsx +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/template_files/Assets/src/index.organizer.js +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/template_files/Assets/src/index.style.scss +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/template_files/Assets/tests/config/post-test-teardown.js +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/template_files/Assets/tests/config/pre-test-setup.js +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/template_files/Assets/tests/config/test-setup.js +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/template_files/Assets/webpack.config/webpack.default.config.jsx +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/template_files/Assets/webpack.config/webpack.development.config.jsx +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/template_files/Assets/webpack.config/webpack.production.config.jsx +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/template_files/apps/sdc_examples/Add_SDCUser.txt +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/template_files/apps/sdc_examples/index.html +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/template_files/apps/sdc_examples/server_call.txt +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/template_files/asgi.py.txt +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/template_files/controller/templade_view.html +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/template_files/controller/template_controller.js.txt +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/template_files/controller/template_css.scss +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/template_files/controller/template_test.js.text +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/template_files/js_test.js.txt +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/template_files/models/detail.html +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/template_files/models/list.html +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/template_files/routing.py.txt +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/template_files/sdc_urls.py.txt +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/template_files/sdc_views.py.txt +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/template_files/templates/index.html +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/Assets/src/sdc_tools/controller/sdc_alert_messenger/sdc_alert_messenger.js +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/Assets/src/sdc_tools/controller/sdc_alert_messenger/sdc_alert_messenger.scss +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/Assets/src/sdc_tools/controller/sdc_auto_submit/sdc_auto_submit.js +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/Assets/src/sdc_tools/controller/sdc_detail_view/sdc_detail_view.js +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/Assets/src/sdc_tools/controller/sdc_detail_view/sdc_detail_view.scss +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/Assets/src/sdc_tools/controller/sdc_dummy/sdc_dummy.js +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/Assets/src/sdc_tools/controller/sdc_dummy/sdc_dummy.scss +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/Assets/src/sdc_tools/controller/sdc_error/sdc_error.js +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/Assets/src/sdc_tools/controller/sdc_error/sdc_error.scss +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/Assets/src/sdc_tools/controller/sdc_list_view/sdc_list_view.js +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/Assets/src/sdc_tools/controller/sdc_list_view/sdc_list_view.scss +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/Assets/src/sdc_tools/controller/sdc_model_form/sdc_model_form.js +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/Assets/src/sdc_tools/controller/sdc_model_form/sdc_model_form.scss +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/Assets/src/sdc_tools/controller/sdc_navigation_client/sdc_navigation_client.js +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/Assets/src/sdc_tools/controller/sdc_navigator/sdc_navigator.js +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/Assets/src/sdc_tools/controller/sdc_navigator/sdc_navigator.scss +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/Assets/src/sdc_tools/controller/sdc_search_view/sdc_search_view.js +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/Assets/src/sdc_tools/controller/sdc_search_view/sdc_search_view.scss +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/Assets/src/sdc_tools/controller/sdc_update_on_change/sdc_update_on_change.js +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/Assets/src/sdc_tools/sdc_tools.organizer.js +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/Assets/src/sdc_tools/sdc_tools.style.scss +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/Assets/tests/sdc_tools.test.js +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/__init__.py +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/admin.py +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/apps.py +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/migrations/__init__.py +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/models.py +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/sdc_urls.py +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/sdc_views.py +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/templates/elements/form.html +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/templates/elements/inline_form.html +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/templates/email/base.html +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/templates/sdc_tools/sdc/dummy_sdc.html +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/templates/sdc_tools/sdc/sdc_alert_messenger.html +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/templates/sdc_tools/sdc/sdc_detail_view.html +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/templates/sdc_tools/sdc/sdc_dummy.html +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/templates/sdc_tools/sdc/sdc_error.html +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/templates/sdc_tools/sdc/sdc_list_view.html +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/templates/sdc_tools/sdc/sdc_model_form.html +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/templates/sdc_tools/sdc/sdc_navigator.html +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/templates/sdc_tools/sdc/sdc_search_view.html +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/templatetags/__init__.py +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/templatetags/addclass.py +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/templatetags/indexfilter.py +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/templatetags/sdc_filter.py +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/tests.py +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/views.py +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_user/Assets/src/sdc_user/controller/sdc_login/sdc_login.js +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_user/Assets/src/sdc_user/controller/sdc_login/sdc_login.scss +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_user/Assets/src/sdc_user/controller/sdc_logout/sdc_logout.js +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_user/Assets/src/sdc_user/controller/sdc_logout/sdc_logout.scss +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_user/Assets/src/sdc_user/controller/sdc_user_nav_btn/sdc_user_nav_btn.js +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_user/Assets/src/sdc_user/controller/sdc_user_nav_btn/sdc_user_nav_btn.scss +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_user/Assets/src/sdc_user/sdc_user.organizer.js +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_user/Assets/src/sdc_user/sdc_user.style.scss +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_user/Assets/tests/sdc_user.test.js +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_user/__init__.py +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_user/admin.py +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_user/apps.py +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_user/migrations/__init__.py +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_user/models.py +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_user/sdc_urls.py +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_user/sdc_views.py +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_user/templates/sdc_user/sdc/sdc_login.html +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_user/templates/sdc_user/sdc/sdc_logout.html +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_user/templates/sdc_user/sdc/sdc_user_nav_btn.html +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_user/tests.py +0 -0
- {simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_user/views.py +0 -0
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import asyncio
|
|
1
2
|
import os
|
|
2
3
|
import types
|
|
3
4
|
import traceback
|
|
5
|
+
|
|
4
6
|
from django.conf import settings
|
|
5
7
|
from django.core.exceptions import PermissionDenied
|
|
6
8
|
from django.core.files.uploadhandler import TemporaryFileUploadHandler
|
|
@@ -8,7 +10,7 @@ from django.core.files.uploadhandler import TemporaryFileUploadHandler
|
|
|
8
10
|
from django.utils.datastructures import MultiValueDict
|
|
9
11
|
from django.utils.translation import gettext as _f
|
|
10
12
|
from django.contrib.auth import get_user_model
|
|
11
|
-
from channels.generic.websocket import WebsocketConsumer
|
|
13
|
+
from channels.generic.websocket import WebsocketConsumer, AsyncWebsocketConsumer
|
|
12
14
|
|
|
13
15
|
from asgiref.sync import async_to_sync
|
|
14
16
|
import importlib
|
|
@@ -65,24 +67,23 @@ class MsgManager:
|
|
|
65
67
|
'delete': {'header': f'{model} was deleted', 'msg': '{0} was changed'}}
|
|
66
68
|
|
|
67
69
|
|
|
68
|
-
class SDCConsumer(
|
|
70
|
+
class SDCConsumer(AsyncWebsocketConsumer):
|
|
69
71
|
|
|
70
|
-
def connect(self):
|
|
71
|
-
|
|
72
|
-
self.scope["session"].save()
|
|
73
|
-
self.accept()
|
|
72
|
+
async def connect(self):
|
|
73
|
+
await self.accept()
|
|
74
74
|
self.group_list = []
|
|
75
75
|
self.queryset = None
|
|
76
76
|
|
|
77
|
-
def
|
|
77
|
+
async def websocket_disconnect(self, close_code):
|
|
78
78
|
for group in self.group_list:
|
|
79
|
-
|
|
79
|
+
await self.channel_layer.group_discard(
|
|
80
80
|
group,
|
|
81
81
|
self.channel_name
|
|
82
82
|
)
|
|
83
|
+
await super().websocket_disconnect(close_code)
|
|
83
84
|
|
|
84
|
-
def state_sdc_event(self, event):
|
|
85
|
-
self.send(text_data=json.dumps({
|
|
85
|
+
async def state_sdc_event(self, event):
|
|
86
|
+
await self.send(text_data=json.dumps({
|
|
86
87
|
'type': 'sdc_event',
|
|
87
88
|
'event': event.get('event', False),
|
|
88
89
|
'msg': event.get('msg', False),
|
|
@@ -91,11 +92,11 @@ class SDCConsumer(WebsocketConsumer):
|
|
|
91
92
|
'is_error': False
|
|
92
93
|
}))
|
|
93
94
|
|
|
94
|
-
def state_redirect(self, event):
|
|
95
|
+
async def state_redirect(self, event):
|
|
95
96
|
if 'controller' in event:
|
|
96
97
|
event['link'] = sdc_link_factory(event.get('controller'), event.get('args'))
|
|
97
98
|
|
|
98
|
-
self.send(text_data=json.dumps({
|
|
99
|
+
await self.send(text_data=json.dumps({
|
|
99
100
|
'type': 'sdc_redirect',
|
|
100
101
|
'msg': event.get('msg', False),
|
|
101
102
|
'header': event.get('header', False),
|
|
@@ -103,8 +104,8 @@ class SDCConsumer(WebsocketConsumer):
|
|
|
103
104
|
'is_error': False
|
|
104
105
|
}))
|
|
105
106
|
|
|
106
|
-
def state_error(self, event, id=None):
|
|
107
|
-
self.send(text_data=json.dumps({
|
|
107
|
+
async def state_error(self, event, id=None):
|
|
108
|
+
await self.send(text_data=json.dumps({
|
|
108
109
|
'type': 'error',
|
|
109
110
|
'id': id,
|
|
110
111
|
'is_error': True,
|
|
@@ -119,10 +120,9 @@ class SDCConsumer(WebsocketConsumer):
|
|
|
119
120
|
# with the 'title' method and join them together.
|
|
120
121
|
return ''.join(x.title() for x in components)
|
|
121
122
|
|
|
122
|
-
def receive(self, text_data=None, bytes_data=None):
|
|
123
|
+
async def receive(self, text_data=None, bytes_data=None):
|
|
123
124
|
json_data = {}
|
|
124
125
|
try:
|
|
125
|
-
session = self.scope['session'].load()
|
|
126
126
|
json_data = json.loads(text_data)
|
|
127
127
|
if json_data['event'] == 'sdc_call':
|
|
128
128
|
controller_name = self.to_camel_case(json_data['controller'])
|
|
@@ -134,14 +134,17 @@ class SDCConsumer(WebsocketConsumer):
|
|
|
134
134
|
method = getattr(controller(), json_data['function'])
|
|
135
135
|
|
|
136
136
|
logger.info(f"SDC call Socket received: {json_data['app']}.{controller_name}.{json_data['function']}")
|
|
137
|
+
if asyncio.iscoroutinefunction(method):
|
|
138
|
+
return_vals = await method(self, **json_data.get('args', {}))
|
|
139
|
+
else:
|
|
140
|
+
return_vals = method(self, **json_data.get('args', {}))
|
|
137
141
|
|
|
138
|
-
return_vals = method(channel=self, **json_data.get('args', {}))
|
|
139
142
|
return_vals_generator = []
|
|
140
143
|
if isinstance(return_vals, types.GeneratorType):
|
|
141
144
|
return_vals_generator = return_vals
|
|
142
145
|
return_vals = next(return_vals, None)
|
|
143
146
|
|
|
144
|
-
self.send(text_data=json.dumps({
|
|
147
|
+
await self.send(text_data=json.dumps({
|
|
145
148
|
'id': json_data['id'],
|
|
146
149
|
'type': 'sdc_recall',
|
|
147
150
|
'data': return_vals,
|
|
@@ -152,7 +155,7 @@ class SDCConsumer(WebsocketConsumer):
|
|
|
152
155
|
raise ValueError("event must be sdc_call")
|
|
153
156
|
|
|
154
157
|
except PermissionDenied:
|
|
155
|
-
self.state_error({
|
|
158
|
+
await self.state_error({
|
|
156
159
|
'msg': _f('403 Not allowed!'),
|
|
157
160
|
'header': _f('Upps!!')
|
|
158
161
|
}, json_data.get('id'))
|
|
@@ -163,7 +166,7 @@ class SDCConsumer(WebsocketConsumer):
|
|
|
163
166
|
logger.error('\n'.join(e_text))
|
|
164
167
|
if not settings.DEBUG:
|
|
165
168
|
e_text = _f('Something went wrong')
|
|
166
|
-
self.state_error({
|
|
169
|
+
await self.state_error({
|
|
167
170
|
'msg': e_text,
|
|
168
171
|
'header': _f('Upps!!')
|
|
169
172
|
}, json_data.get('id'))
|
|
@@ -190,9 +193,10 @@ class SDCModelConsumer(WebsocketConsumer):
|
|
|
190
193
|
self.scope["session"].save()
|
|
191
194
|
self.accept()
|
|
192
195
|
|
|
193
|
-
def
|
|
196
|
+
def websocket_disconnect(self, close_code):
|
|
194
197
|
for group in self._group_names:
|
|
195
198
|
async_to_sync(self.channel_layer.group_discard( group, self.channel_name ))
|
|
199
|
+
super().websocket_disconnect(close_code)
|
|
196
200
|
|
|
197
201
|
def on_update(self, data):
|
|
198
202
|
if data['pk'] in self.ids:
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import json
|
|
2
|
+
|
|
1
3
|
from django.contrib.auth.mixins import AccessMixin
|
|
2
4
|
from django.core.exceptions import PermissionDenied, ImproperlyConfigured
|
|
5
|
+
from django.http import HttpResponse
|
|
3
6
|
from django.views import View
|
|
4
7
|
from functools import wraps
|
|
5
|
-
from sdc_core.sdc_extentions.response import send_redirect
|
|
8
|
+
from sdc_core.sdc_extentions.response import send_redirect, send_success
|
|
6
9
|
from django.conf import settings
|
|
7
10
|
|
|
8
11
|
class SdcAccessMixin(AccessMixin):
|
|
@@ -93,6 +96,15 @@ class SDCView(View):
|
|
|
93
96
|
if request.method.lower() == 'get' and request.GET.get('_method') == 'api':
|
|
94
97
|
request.method += '_api'
|
|
95
98
|
|
|
99
|
+
if request.method.lower() == 'post' and request.POST.get('_method') == 'sdc_server_call':
|
|
100
|
+
handler = getattr(
|
|
101
|
+
self, request.POST.get('_sdc_func_name'), self.http_method_not_allowed
|
|
102
|
+
)
|
|
103
|
+
res = handler(request, **json.loads(request.POST.get('data')))
|
|
104
|
+
if isinstance(res, HttpResponse):
|
|
105
|
+
return res
|
|
106
|
+
return send_success(_return_data=res)
|
|
107
|
+
|
|
96
108
|
return super(SDCView, self).dispatch(request, *args, **kwargs)
|
|
97
109
|
|
|
98
110
|
|
{simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/template_files/templates/base.html
RENAMED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
window.LANGUAGE_CODE = "{{ LANGUAGE_CODE | default:'de' }}";
|
|
15
15
|
window.CSRF_TOKEN = '{{ csrf_token }}';
|
|
16
16
|
window.DEBUG = {% if debug %} true {% else %} false {% endif %};
|
|
17
|
+
window.SERVER_CALL_VIA_WEB_SOCKET = {% if server_call_via_web_socket %} true {% else %} false {% endif %};
|
|
17
18
|
window.VERSION = '{{VERSION}}';
|
|
18
19
|
</script>
|
|
19
20
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
def index(request):
|
|
2
|
-
return render(request, 'index.html', {'VERSION': settings.VERSION})
|
|
2
|
+
return render(request, 'index.html', {'VERSION': settings.VERSION, 'debug': settings.DEBUG, 'server_call_via_web_socket': settings.SERVER_CALL_VIA_WEB_SOCKET})
|
|
3
3
|
|
|
4
4
|
urlpatterns += [
|
|
5
5
|
re_path(r'^jsi18n/$', JavaScriptCatalog.as_view(), name='javascript-catalog'),
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/management/commands/__init__.py
RENAMED
|
File without changes
|
{simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/management/commands/_private.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/management/commands/init_add/options.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/management/commands/init_add/utils.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/management/commands/sdc_init.py
RENAMED
|
File without changes
|
{simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/management/commands/sdc_is_installed.py
RENAMED
|
File without changes
|
{simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/management/commands/sdc_new_model.py
RENAMED
|
File without changes
|
|
File without changes
|
{simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/management/commands/sdc_update_links.py
RENAMED
|
File without changes
|
{simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/management/commands/sdc_update_url.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/sdc_extentions/import_manager.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/template_files/Assets/gulpfile.jsx
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/template_files/models/detail.html
RENAMED
|
File without changes
|
{simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/template_files/models/list.html
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/template_files/sdc_views.py.txt
RENAMED
|
File without changes
|
{simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_core/template_files/templates/index.html
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/Assets/tests/sdc_tools.test.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/templates/elements/inline_form.html
RENAMED
|
File without changes
|
|
File without changes
|
{simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/templates/sdc_tools/sdc/dummy_sdc.html
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/templates/sdc_tools/sdc/sdc_dummy.html
RENAMED
|
File without changes
|
{simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_tools/templates/sdc_tools/sdc/sdc_error.html
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_user/Assets/src/sdc_user/sdc_user.style.scss
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_user/templates/sdc_user/sdc/sdc_login.html
RENAMED
|
File without changes
|
{simpledomcontrol-0.56.3 → simpledomcontrol-0.56.5}/sdc_user/templates/sdc_user/sdc/sdc_logout.html
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|