simpledomcontrol 0.56.4__tar.gz → 0.57.0__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.4 → simpledomcontrol-0.57.0}/PKG-INFO +1 -1
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/pyproject.toml +1 -1
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/consumers.py +23 -21
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/sdc_extentions/views.py +13 -1
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/template_files/package.json +1 -1
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/template_files/settings_extension.py.txt +2 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/template_files/templates/base.html +1 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/template_files/urls.py.txt +1 -1
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/README.md +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/__init__.py +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/apps.py +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/management/__init__.py +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/management/commands/__init__.py +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/management/commands/_private.py +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/management/commands/init_add/__init__.py +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/management/commands/init_add/add_controller_manager.py +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/management/commands/init_add/add_model_manager.py +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/management/commands/init_add/options.py +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/management/commands/init_add/sdc_core_manager.py +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/management/commands/init_add/settings_manager.py +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/management/commands/init_add/utils.py +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/management/commands/sdc_cc.py +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/management/commands/sdc_get_controller_infos.py +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/management/commands/sdc_get_controller_url.py +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/management/commands/sdc_get_model_infos.py +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/management/commands/sdc_init.py +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/management/commands/sdc_is_installed.py +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/management/commands/sdc_new_model.py +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/management/commands/sdc_shell_execute_script.py +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/management/commands/sdc_update_links.py +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/management/commands/sdc_update_url.py +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/sdc_extentions/__init__.py +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/sdc_extentions/forms.py +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/sdc_extentions/import_manager.py +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/sdc_extentions/models.py +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/sdc_extentions/response.py +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/sdc_extentions/search.py +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/template_files/Assets/.babelrc +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/template_files/Assets/gulpfile.jsx +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/template_files/Assets/src/index.organizer.js +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/template_files/Assets/src/index.style.scss +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/template_files/Assets/tests/config/post-test-teardown.js +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/template_files/Assets/tests/config/pre-test-setup.js +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/template_files/Assets/tests/config/test-setup.js +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/template_files/Assets/webpack.config/webpack.default.config.jsx +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/template_files/Assets/webpack.config/webpack.development.config.jsx +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/template_files/Assets/webpack.config/webpack.production.config.jsx +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/template_files/apps/sdc_examples/Add_SDCUser.txt +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/template_files/apps/sdc_examples/index.html +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/template_files/apps/sdc_examples/server_call.txt +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/template_files/asgi.py.txt +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/template_files/controller/templade_view.html +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/template_files/controller/template_controller.js.txt +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/template_files/controller/template_css.scss +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/template_files/controller/template_test.js.text +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/template_files/js_test.js.txt +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/template_files/models/detail.html +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/template_files/models/list.html +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/template_files/routing.py.txt +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/template_files/sdc_urls.py.txt +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/template_files/sdc_views.py.txt +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/template_files/templates/index.html +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_tools/Assets/src/sdc_tools/controller/sdc_alert_messenger/sdc_alert_messenger.js +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_tools/Assets/src/sdc_tools/controller/sdc_alert_messenger/sdc_alert_messenger.scss +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_tools/Assets/src/sdc_tools/controller/sdc_auto_submit/sdc_auto_submit.js +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_tools/Assets/src/sdc_tools/controller/sdc_detail_view/sdc_detail_view.js +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_tools/Assets/src/sdc_tools/controller/sdc_detail_view/sdc_detail_view.scss +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_tools/Assets/src/sdc_tools/controller/sdc_dummy/sdc_dummy.js +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_tools/Assets/src/sdc_tools/controller/sdc_dummy/sdc_dummy.scss +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_tools/Assets/src/sdc_tools/controller/sdc_error/sdc_error.js +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_tools/Assets/src/sdc_tools/controller/sdc_error/sdc_error.scss +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_tools/Assets/src/sdc_tools/controller/sdc_list_view/sdc_list_view.js +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_tools/Assets/src/sdc_tools/controller/sdc_list_view/sdc_list_view.scss +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_tools/Assets/src/sdc_tools/controller/sdc_model_form/sdc_model_form.js +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_tools/Assets/src/sdc_tools/controller/sdc_model_form/sdc_model_form.scss +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_tools/Assets/src/sdc_tools/controller/sdc_navigation_client/sdc_navigation_client.js +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_tools/Assets/src/sdc_tools/controller/sdc_navigator/sdc_navigator.js +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_tools/Assets/src/sdc_tools/controller/sdc_navigator/sdc_navigator.scss +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_tools/Assets/src/sdc_tools/controller/sdc_search_view/sdc_search_view.js +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_tools/Assets/src/sdc_tools/controller/sdc_search_view/sdc_search_view.scss +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_tools/Assets/src/sdc_tools/controller/sdc_update_on_change/sdc_update_on_change.js +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_tools/Assets/src/sdc_tools/sdc_tools.organizer.js +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_tools/Assets/src/sdc_tools/sdc_tools.style.scss +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_tools/Assets/tests/sdc_tools.test.js +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_tools/__init__.py +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_tools/admin.py +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_tools/apps.py +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_tools/migrations/__init__.py +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_tools/models.py +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_tools/sdc_urls.py +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_tools/sdc_views.py +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_tools/templates/elements/form.html +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_tools/templates/elements/inline_form.html +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_tools/templates/email/base.html +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_tools/templates/sdc_tools/sdc/dummy_sdc.html +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_tools/templates/sdc_tools/sdc/sdc_alert_messenger.html +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_tools/templates/sdc_tools/sdc/sdc_detail_view.html +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_tools/templates/sdc_tools/sdc/sdc_dummy.html +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_tools/templates/sdc_tools/sdc/sdc_error.html +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_tools/templates/sdc_tools/sdc/sdc_list_view.html +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_tools/templates/sdc_tools/sdc/sdc_model_form.html +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_tools/templates/sdc_tools/sdc/sdc_navigator.html +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_tools/templates/sdc_tools/sdc/sdc_search_view.html +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_tools/templatetags/__init__.py +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_tools/templatetags/addclass.py +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_tools/templatetags/indexfilter.py +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_tools/templatetags/sdc_filter.py +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_tools/tests.py +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_tools/views.py +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_user/Assets/src/sdc_user/controller/sdc_login/sdc_login.js +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_user/Assets/src/sdc_user/controller/sdc_login/sdc_login.scss +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_user/Assets/src/sdc_user/controller/sdc_logout/sdc_logout.js +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_user/Assets/src/sdc_user/controller/sdc_logout/sdc_logout.scss +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_user/Assets/src/sdc_user/controller/sdc_user_nav_btn/sdc_user_nav_btn.js +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_user/Assets/src/sdc_user/controller/sdc_user_nav_btn/sdc_user_nav_btn.scss +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_user/Assets/src/sdc_user/sdc_user.organizer.js +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_user/Assets/src/sdc_user/sdc_user.style.scss +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_user/Assets/tests/sdc_user.test.js +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_user/__init__.py +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_user/admin.py +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_user/apps.py +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_user/migrations/__init__.py +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_user/models.py +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_user/sdc_urls.py +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_user/sdc_views.py +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_user/templates/sdc_user/sdc/sdc_login.html +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_user/templates/sdc_user/sdc/sdc_logout.html +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_user/templates/sdc_user/sdc/sdc_user_nav_btn.html +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_user/tests.py +0 -0
- {simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/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,25 +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 websocket_disconnect(self, close_code):
|
|
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
|
-
super().websocket_disconnect(close_code)
|
|
83
|
+
await super().websocket_disconnect(close_code)
|
|
84
84
|
|
|
85
|
-
def state_sdc_event(self, event):
|
|
86
|
-
self.send(text_data=json.dumps({
|
|
85
|
+
async def state_sdc_event(self, event):
|
|
86
|
+
await self.send(text_data=json.dumps({
|
|
87
87
|
'type': 'sdc_event',
|
|
88
88
|
'event': event.get('event', False),
|
|
89
89
|
'msg': event.get('msg', False),
|
|
@@ -92,11 +92,11 @@ class SDCConsumer(WebsocketConsumer):
|
|
|
92
92
|
'is_error': False
|
|
93
93
|
}))
|
|
94
94
|
|
|
95
|
-
def state_redirect(self, event):
|
|
95
|
+
async def state_redirect(self, event):
|
|
96
96
|
if 'controller' in event:
|
|
97
97
|
event['link'] = sdc_link_factory(event.get('controller'), event.get('args'))
|
|
98
98
|
|
|
99
|
-
self.send(text_data=json.dumps({
|
|
99
|
+
await self.send(text_data=json.dumps({
|
|
100
100
|
'type': 'sdc_redirect',
|
|
101
101
|
'msg': event.get('msg', False),
|
|
102
102
|
'header': event.get('header', False),
|
|
@@ -104,8 +104,8 @@ class SDCConsumer(WebsocketConsumer):
|
|
|
104
104
|
'is_error': False
|
|
105
105
|
}))
|
|
106
106
|
|
|
107
|
-
def state_error(self, event, id=None):
|
|
108
|
-
self.send(text_data=json.dumps({
|
|
107
|
+
async def state_error(self, event, id=None):
|
|
108
|
+
await self.send(text_data=json.dumps({
|
|
109
109
|
'type': 'error',
|
|
110
110
|
'id': id,
|
|
111
111
|
'is_error': True,
|
|
@@ -120,10 +120,9 @@ class SDCConsumer(WebsocketConsumer):
|
|
|
120
120
|
# with the 'title' method and join them together.
|
|
121
121
|
return ''.join(x.title() for x in components)
|
|
122
122
|
|
|
123
|
-
def receive(self, text_data=None, bytes_data=None):
|
|
123
|
+
async def receive(self, text_data=None, bytes_data=None):
|
|
124
124
|
json_data = {}
|
|
125
125
|
try:
|
|
126
|
-
session = self.scope['session'].load()
|
|
127
126
|
json_data = json.loads(text_data)
|
|
128
127
|
if json_data['event'] == 'sdc_call':
|
|
129
128
|
controller_name = self.to_camel_case(json_data['controller'])
|
|
@@ -135,14 +134,17 @@ class SDCConsumer(WebsocketConsumer):
|
|
|
135
134
|
method = getattr(controller(), json_data['function'])
|
|
136
135
|
|
|
137
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', {}))
|
|
138
141
|
|
|
139
|
-
return_vals = method(channel=self, **json_data.get('args', {}))
|
|
140
142
|
return_vals_generator = []
|
|
141
143
|
if isinstance(return_vals, types.GeneratorType):
|
|
142
144
|
return_vals_generator = return_vals
|
|
143
145
|
return_vals = next(return_vals, None)
|
|
144
146
|
|
|
145
|
-
self.send(text_data=json.dumps({
|
|
147
|
+
await self.send(text_data=json.dumps({
|
|
146
148
|
'id': json_data['id'],
|
|
147
149
|
'type': 'sdc_recall',
|
|
148
150
|
'data': return_vals,
|
|
@@ -153,7 +155,7 @@ class SDCConsumer(WebsocketConsumer):
|
|
|
153
155
|
raise ValueError("event must be sdc_call")
|
|
154
156
|
|
|
155
157
|
except PermissionDenied:
|
|
156
|
-
self.state_error({
|
|
158
|
+
await self.state_error({
|
|
157
159
|
'msg': _f('403 Not allowed!'),
|
|
158
160
|
'header': _f('Upps!!')
|
|
159
161
|
}, json_data.get('id'))
|
|
@@ -164,7 +166,7 @@ class SDCConsumer(WebsocketConsumer):
|
|
|
164
166
|
logger.error('\n'.join(e_text))
|
|
165
167
|
if not settings.DEBUG:
|
|
166
168
|
e_text = _f('Something went wrong')
|
|
167
|
-
self.state_error({
|
|
169
|
+
await self.state_error({
|
|
168
170
|
'msg': e_text,
|
|
169
171
|
'header': _f('Upps!!')
|
|
170
172
|
}, json_data.get('id'))
|
|
@@ -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.4 → simpledomcontrol-0.57.0}/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.4 → simpledomcontrol-0.57.0}/sdc_core/management/commands/__init__.py
RENAMED
|
File without changes
|
{simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/management/commands/_private.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/management/commands/init_add/options.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/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.4 → simpledomcontrol-0.57.0}/sdc_core/management/commands/sdc_init.py
RENAMED
|
File without changes
|
{simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/management/commands/sdc_is_installed.py
RENAMED
|
File without changes
|
{simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/management/commands/sdc_new_model.py
RENAMED
|
File without changes
|
|
File without changes
|
{simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/management/commands/sdc_update_links.py
RENAMED
|
File without changes
|
{simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/management/commands/sdc_update_url.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/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.4 → simpledomcontrol-0.57.0}/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.4 → simpledomcontrol-0.57.0}/sdc_core/template_files/models/detail.html
RENAMED
|
File without changes
|
{simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/template_files/models/list.html
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_core/template_files/sdc_views.py.txt
RENAMED
|
File without changes
|
{simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/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.4 → simpledomcontrol-0.57.0}/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.4 → simpledomcontrol-0.57.0}/sdc_tools/templates/elements/inline_form.html
RENAMED
|
File without changes
|
|
File without changes
|
{simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_tools/templates/sdc_tools/sdc/dummy_sdc.html
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_tools/templates/sdc_tools/sdc/sdc_dummy.html
RENAMED
|
File without changes
|
{simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/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.4 → simpledomcontrol-0.57.0}/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.4 → simpledomcontrol-0.57.0}/sdc_user/templates/sdc_user/sdc/sdc_login.html
RENAMED
|
File without changes
|
{simpledomcontrol-0.56.4 → simpledomcontrol-0.57.0}/sdc_user/templates/sdc_user/sdc/sdc_logout.html
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|