simpledomcontrol 0.55.4__tar.gz → 0.56.1__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.55.4 → simpledomcontrol-0.56.1}/PKG-INFO +9 -5
- simpledomcontrol-0.56.1/README.md +5 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/pyproject.toml +8 -4
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/consumers.py +11 -11
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/management/commands/init_add/add_model_manager.py +15 -12
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/management/commands/init_add/settings_manager.py +2 -2
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/management/commands/sdc_get_model_infos.py +8 -8
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/management/commands/sdc_new_model.py +1 -1
- simpledomcontrol-0.56.1/sdc_core/sdc_extentions/forms.py +48 -0
- simpledomcontrol-0.56.1/sdc_core/sdc_extentions/import_manager.py +18 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/sdc_extentions/models.py +90 -11
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/sdc_extentions/response.py +6 -8
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/sdc_extentions/search.py +15 -5
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/template_files/Assets/gulpfile.jsx +13 -2
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/template_files/Assets/src/index.style.scss +8 -8
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/template_files/controller/template_controller.js.txt +16 -2
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/template_files/package.json +4 -3
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_tools/Assets/src/sdc_tools/controller/sdc_navigator/sdc_navigator.js +0 -4
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_tools/Assets/src/sdc_tools/controller/sdc_search_view/sdc_search_view.js +1 -1
- simpledomcontrol-0.55.4/README.md +0 -1
- simpledomcontrol-0.55.4/sdc_core/sdc_extentions/forms.py +0 -26
- simpledomcontrol-0.55.4/sdc_core/sdc_extentions/import_manager.py +0 -18
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/__init__.py +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/apps.py +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/management/__init__.py +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/management/commands/__init__.py +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/management/commands/_private.py +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/management/commands/init_add/__init__.py +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/management/commands/init_add/add_controller_manager.py +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/management/commands/init_add/options.py +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/management/commands/init_add/sdc_core_manager.py +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/management/commands/init_add/utils.py +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/management/commands/sdc_cc.py +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/management/commands/sdc_get_controller_infos.py +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/management/commands/sdc_get_controller_url.py +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/management/commands/sdc_init.py +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/management/commands/sdc_is_installed.py +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/management/commands/sdc_shell_execute_script.py +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/management/commands/sdc_update_links.py +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/management/commands/sdc_update_url.py +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/sdc_extentions/__init__.py +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/sdc_extentions/views.py +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/template_files/Assets/.babelrc +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/template_files/Assets/src/index.organizer.js +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/template_files/Assets/tests/config/post-test-teardown.js +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/template_files/Assets/tests/config/pre-test-setup.js +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/template_files/Assets/tests/config/test-setup.js +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/template_files/Assets/webpack.config/webpack.default.config.jsx +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/template_files/Assets/webpack.config/webpack.development.config.jsx +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/template_files/Assets/webpack.config/webpack.production.config.jsx +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/template_files/apps/sdc_examples/Add_SDCUser.txt +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/template_files/apps/sdc_examples/index.html +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/template_files/apps/sdc_examples/server_call.txt +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/template_files/asgi.py.txt +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/template_files/controller/templade_view.html +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/template_files/controller/template_css.scss +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/template_files/controller/template_test.js.text +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/template_files/js_test.js.txt +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/template_files/models/detail.html +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/template_files/models/list.html +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/template_files/routing.py.txt +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/template_files/sdc_urls.py.txt +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/template_files/sdc_views.py.txt +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/template_files/settings_extension.py.txt +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/template_files/templates/base.html +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/template_files/templates/index.html +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/template_files/urls.py.txt +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_tools/Assets/src/sdc_tools/controller/sdc_alert_messenger/sdc_alert_messenger.js +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_tools/Assets/src/sdc_tools/controller/sdc_alert_messenger/sdc_alert_messenger.scss +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_tools/Assets/src/sdc_tools/controller/sdc_auto_submit/sdc_auto_submit.js +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_tools/Assets/src/sdc_tools/controller/sdc_detail_view/sdc_detail_view.js +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_tools/Assets/src/sdc_tools/controller/sdc_detail_view/sdc_detail_view.scss +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_tools/Assets/src/sdc_tools/controller/sdc_dummy/sdc_dummy.js +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_tools/Assets/src/sdc_tools/controller/sdc_dummy/sdc_dummy.scss +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_tools/Assets/src/sdc_tools/controller/sdc_error/sdc_error.js +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_tools/Assets/src/sdc_tools/controller/sdc_error/sdc_error.scss +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_tools/Assets/src/sdc_tools/controller/sdc_list_view/sdc_list_view.js +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_tools/Assets/src/sdc_tools/controller/sdc_list_view/sdc_list_view.scss +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_tools/Assets/src/sdc_tools/controller/sdc_model_form/sdc_model_form.js +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_tools/Assets/src/sdc_tools/controller/sdc_model_form/sdc_model_form.scss +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_tools/Assets/src/sdc_tools/controller/sdc_navigation_client/sdc_navigation_client.js +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_tools/Assets/src/sdc_tools/controller/sdc_navigator/sdc_navigator.scss +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_tools/Assets/src/sdc_tools/controller/sdc_search_view/sdc_search_view.scss +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_tools/Assets/src/sdc_tools/controller/sdc_update_on_change/sdc_update_on_change.js +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_tools/Assets/src/sdc_tools/sdc_tools.organizer.js +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_tools/Assets/src/sdc_tools/sdc_tools.style.scss +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_tools/Assets/tests/sdc_tools.test.js +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_tools/__init__.py +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_tools/admin.py +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_tools/apps.py +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_tools/migrations/__init__.py +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_tools/models.py +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_tools/sdc_urls.py +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_tools/sdc_views.py +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_tools/templates/elements/form.html +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_tools/templates/elements/inline_form.html +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_tools/templates/email/base.html +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_tools/templates/sdc_tools/sdc/dummy_sdc.html +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_tools/templates/sdc_tools/sdc/sdc_alert_messenger.html +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_tools/templates/sdc_tools/sdc/sdc_detail_view.html +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_tools/templates/sdc_tools/sdc/sdc_dummy.html +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_tools/templates/sdc_tools/sdc/sdc_error.html +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_tools/templates/sdc_tools/sdc/sdc_list_view.html +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_tools/templates/sdc_tools/sdc/sdc_model_form.html +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_tools/templates/sdc_tools/sdc/sdc_navigator.html +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_tools/templates/sdc_tools/sdc/sdc_search_view.html +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_tools/templatetags/__init__.py +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_tools/templatetags/addclass.py +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_tools/templatetags/indexfilter.py +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_tools/templatetags/sdc_filter.py +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_tools/tests.py +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_tools/views.py +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_user/Assets/src/sdc_user/controller/sdc_login/sdc_login.js +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_user/Assets/src/sdc_user/controller/sdc_login/sdc_login.scss +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_user/Assets/src/sdc_user/controller/sdc_logout/sdc_logout.js +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_user/Assets/src/sdc_user/controller/sdc_logout/sdc_logout.scss +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_user/Assets/src/sdc_user/controller/sdc_user_nav_btn/sdc_user_nav_btn.js +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_user/Assets/src/sdc_user/controller/sdc_user_nav_btn/sdc_user_nav_btn.scss +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_user/Assets/src/sdc_user/sdc_user.organizer.js +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_user/Assets/src/sdc_user/sdc_user.style.scss +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_user/Assets/tests/sdc_user.test.js +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_user/__init__.py +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_user/admin.py +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_user/apps.py +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_user/migrations/__init__.py +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_user/models.py +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_user/sdc_urls.py +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_user/sdc_views.py +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_user/templates/sdc_user/sdc/sdc_login.html +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_user/templates/sdc_user/sdc/sdc_logout.html +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_user/templates/sdc_user/sdc/sdc_user_nav_btn.html +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_user/tests.py +0 -0
- {simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_user/views.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: SimpleDomControl
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.56.1
|
|
4
4
|
Summary: Simple DOM control -> a django MVC framework
|
|
5
5
|
Home-page: https://github.com/StarmanMartin/sdc
|
|
6
6
|
License: Apache-2.0
|
|
@@ -17,14 +17,18 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.12
|
|
18
18
|
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
19
19
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
20
|
-
Requires-Dist: attrs (>=
|
|
20
|
+
Requires-Dist: attrs (>=24.2.0,<25.0.0)
|
|
21
21
|
Requires-Dist: channels (>=4.1.0,<5.0.0)
|
|
22
22
|
Requires-Dist: channels-redis (>=4.2.0,<5.0.0)
|
|
23
|
+
Requires-Dist: click (>=8.1.7,<9.0.0)
|
|
23
24
|
Requires-Dist: daphne (>=4.1.2,<5.0.0)
|
|
24
|
-
Requires-Dist: django (>=5.
|
|
25
|
+
Requires-Dist: django (>=5.1.2,<6.0.0)
|
|
25
26
|
Requires-Dist: psycopg2-binary (>=2.9.9,<3.0.0)
|
|
26
|
-
Requires-Dist: regex (>=2024.
|
|
27
|
+
Requires-Dist: regex (>=2024.7.24,<2025.0.0)
|
|
27
28
|
Description-Content-Type: text/markdown
|
|
28
29
|
|
|
29
|
-
|
|
30
|
+
# Simple Dom Control (SDC)
|
|
30
31
|
|
|
32
|
+
SDC is a framework that combines elements of both the MVC (Model-View-Controller) and MVT (Model-View-Template) patterns. Its main goal is to provide a tool for simple and efficient web development. The name ‘SDC’ is an abbreviation for ‘Simple DOM Control,’ indicating its focus on controlling and manipulating the Document Object Model (DOM), which is crucial for web development, particularly in dynamic web pages.
|
|
33
|
+
|
|
34
|
+
For detailed docs go to [rtd](https://simpledomcontrol.readthedocs.io/en/latest/)
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Simple Dom Control (SDC)
|
|
2
|
+
|
|
3
|
+
SDC is a framework that combines elements of both the MVC (Model-View-Controller) and MVT (Model-View-Template) patterns. Its main goal is to provide a tool for simple and efficient web development. The name ‘SDC’ is an abbreviation for ‘Simple DOM Control,’ indicating its focus on controlling and manipulating the Document Object Model (DOM), which is crucial for web development, particularly in dynamic web pages.
|
|
4
|
+
|
|
5
|
+
For detailed docs go to [rtd](https://simpledomcontrol.readthedocs.io/en/latest/)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "SimpleDomControl"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.56.1"
|
|
4
4
|
authors = [ "Martin Starman <private@martin-starman.com>", ]
|
|
5
5
|
description = "Simple DOM control -> a django MVC framework"
|
|
6
6
|
readme = "README.md"
|
|
@@ -22,10 +22,11 @@ python = "^3.10"
|
|
|
22
22
|
daphne = "^4.1.2"
|
|
23
23
|
channels = "^4.1.0"
|
|
24
24
|
channels-redis = "^4.2.0"
|
|
25
|
-
django = "^5.
|
|
25
|
+
django = "^5.1.2"
|
|
26
26
|
psycopg2-binary = "^2.9.9"
|
|
27
|
-
attrs = "^
|
|
28
|
-
regex = "^2024.
|
|
27
|
+
attrs = "^24.2.0"
|
|
28
|
+
regex = "^2024.7.24"
|
|
29
|
+
click = "^8.1.7"
|
|
29
30
|
|
|
30
31
|
[tool.pytest.ini_options]
|
|
31
32
|
pythonpath = [
|
|
@@ -38,6 +39,9 @@ testpaths = [
|
|
|
38
39
|
[tool.poetry.group.dev.dependencies]
|
|
39
40
|
pytest = "^7.2.2"
|
|
40
41
|
pillow = "^10.1.0"
|
|
42
|
+
sphinx-toolbox = "^3.6.0"
|
|
43
|
+
sphinx-rtd-theme = "^2.0.0"
|
|
44
|
+
sphinx-markdown-builder = "^0.6.6"
|
|
41
45
|
|
|
42
46
|
[build-system]
|
|
43
47
|
requires = ["poetry-core"]
|
|
@@ -14,7 +14,7 @@ from asgiref.sync import async_to_sync
|
|
|
14
14
|
import importlib
|
|
15
15
|
import json
|
|
16
16
|
|
|
17
|
-
from sdc_core.sdc_extentions.models import SdcModel,
|
|
17
|
+
from sdc_core.sdc_extentions.models import SdcModel, SDCSerializer, all_models
|
|
18
18
|
from sdc_core.sdc_extentions.response import sdc_link_factory, sdc_link_obj_factory
|
|
19
19
|
from sdc_core.sdc_extentions.import_manager import import_function
|
|
20
20
|
from sdc_core.sdc_extentions.views import SdcAccessMixin
|
|
@@ -248,7 +248,7 @@ class SDCModelConsumer(WebsocketConsumer):
|
|
|
248
248
|
elif event_type == 'model_delete':
|
|
249
249
|
self._delete_element(json_data)
|
|
250
250
|
elif event_type == 'model_load':
|
|
251
|
-
model_data =
|
|
251
|
+
model_data = SDCSerializer().serialize(self._load_model())
|
|
252
252
|
self.send(text_data=json.dumps({
|
|
253
253
|
'type': json_data['event_type'],
|
|
254
254
|
'event_id': json_data['event_id'],
|
|
@@ -317,12 +317,12 @@ class SDCModelConsumer(WebsocketConsumer):
|
|
|
317
317
|
def _load_create_form(self, json_data):
|
|
318
318
|
instance: SdcModel = self.model()
|
|
319
319
|
instance.scope = self.scope
|
|
320
|
-
return self._load_form(json_data, self.model.create_form, instance)
|
|
320
|
+
return self._load_form(json_data, self.model.SdcMeta.create_form, instance)
|
|
321
321
|
|
|
322
322
|
def _load_edit_form(self, json_data):
|
|
323
323
|
instance = self._load_model().get(pk=json_data['args']['pk'])
|
|
324
324
|
instance.scope = self.scope
|
|
325
|
-
return self._load_form(json_data, self.model.edit_form, instance)
|
|
325
|
+
return self._load_form(json_data, self.model.SdcMeta.edit_form, instance)
|
|
326
326
|
|
|
327
327
|
def _load_named_form(self, json_data):
|
|
328
328
|
instance = self._load_model().get(pk=json_data['args']['pk'])
|
|
@@ -347,7 +347,7 @@ class SDCModelConsumer(WebsocketConsumer):
|
|
|
347
347
|
self.send(text_data=json.dumps({
|
|
348
348
|
'type': json_data['event_type'],
|
|
349
349
|
'event_id': json_data['event_id'],
|
|
350
|
-
'html': self._render(self.model.html_form_template, {'instance': instance, 'form': form(instance=instance)},
|
|
350
|
+
'html': self._render(self.model.SdcMeta.html_form_template, {'instance': instance, 'form': form(instance=instance)},
|
|
351
351
|
json_data),
|
|
352
352
|
'is_error': False
|
|
353
353
|
}))
|
|
@@ -355,12 +355,12 @@ class SDCModelConsumer(WebsocketConsumer):
|
|
|
355
355
|
def _create_element(self, json_data):
|
|
356
356
|
instance: SdcModel = self.model()
|
|
357
357
|
instance.scope = self.scope
|
|
358
|
-
return self._submit_element(json_data, self.model.create_form, instance)
|
|
358
|
+
return self._submit_element(json_data, self.model.SdcMeta.create_form, instance)
|
|
359
359
|
|
|
360
360
|
def _save_element(self, json_data):
|
|
361
361
|
instance = self._load_model().get(pk=json_data['args']['data']['pk'])
|
|
362
362
|
instance.scope = self.scope
|
|
363
|
-
return self._submit_element(json_data, self.model.edit_form, instance)
|
|
363
|
+
return self._submit_element(json_data, self.model.SdcMeta.edit_form, instance)
|
|
364
364
|
|
|
365
365
|
def _upload_file(self, json_data):
|
|
366
366
|
file_data = json_data['args']
|
|
@@ -406,7 +406,7 @@ class SDCModelConsumer(WebsocketConsumer):
|
|
|
406
406
|
|
|
407
407
|
if is_valid:
|
|
408
408
|
form_instance.save()
|
|
409
|
-
new_instance =
|
|
409
|
+
new_instance = SDCSerializer().serialize(self._load_model().filter(pk=form_instance.instance.pk))
|
|
410
410
|
msg = self.msg_manager.get_msg(form_instance.instance, json_data['event_type'])
|
|
411
411
|
else:
|
|
412
412
|
msg = {'header': 'Upss!',
|
|
@@ -418,20 +418,20 @@ class SDCModelConsumer(WebsocketConsumer):
|
|
|
418
418
|
'type': json_data['event_type'],
|
|
419
419
|
'event_id': json_data['event_id'],
|
|
420
420
|
'data': {'instance': new_instance},
|
|
421
|
-
'html': self._render(self.model.html_form_template,
|
|
421
|
+
'html': self._render(self.model.SdcMeta.html_form_template,
|
|
422
422
|
{'instance': form_instance.instance, 'form': form_instance},
|
|
423
423
|
json_data),
|
|
424
424
|
'is_error': not is_valid
|
|
425
425
|
}))
|
|
426
426
|
|
|
427
427
|
def _load_list_view(self, json_data):
|
|
428
|
-
if self.model.html_list_template is None:
|
|
428
|
+
if self.model.SdcMeta.html_list_template is None:
|
|
429
429
|
raise NotImplemented()
|
|
430
430
|
|
|
431
431
|
self.send(text_data=json.dumps({
|
|
432
432
|
'type': json_data['event_type'],
|
|
433
433
|
'event_id': json_data['event_id'],
|
|
434
|
-
'html': self._render(self.model.html_list_template, {'instances': self._load_model()}, json_data),
|
|
434
|
+
'html': self._render(self.model.SdcMeta.html_list_template, {'instances': self._load_model()}, json_data),
|
|
435
435
|
'is_error': False
|
|
436
436
|
}))
|
|
437
437
|
|
|
@@ -49,22 +49,25 @@ class AddModelManager():
|
|
|
49
49
|
self._check_if_sdcmodel_imported(model_path)
|
|
50
50
|
f = open(model_path, 'a')
|
|
51
51
|
|
|
52
|
-
search_form_def = "\n".join([
|
|
53
|
-
'class {2}SearchForm(AbstractSearchForm):',
|
|
54
|
-
'{0}CHOICES = (("id", "Id"),)',
|
|
55
|
-
'{0}PLACEHOLDER = ""',
|
|
56
|
-
'{0}DEFAULT_CHOICES = CHOICES[0][0]',
|
|
57
|
-
'{0}SEARCH_FIELDS = ("id",)',
|
|
58
|
-
]).format(options.SEP, self.app_name, self.model_name)
|
|
52
|
+
search_form_def = "\n".join([]).format(options.SEP, self.app_name, self.model_name)
|
|
59
53
|
|
|
60
54
|
class_def = "\n".join([
|
|
61
55
|
'class {2}(models.Model, SdcModel):',
|
|
62
|
-
'{0}
|
|
63
|
-
'{0}
|
|
64
|
-
'{0}
|
|
65
|
-
'{0}
|
|
56
|
+
'{0}class SearchForm(AbstractSearchForm):',
|
|
57
|
+
'{0}{0}"""A default search form used in the list view. You can delete it if you dont need it"""',
|
|
58
|
+
'{0}{0}CHOICES = (("id", "Id"),)',
|
|
59
|
+
'{0}{0}PLACEHOLDER = ""',
|
|
60
|
+
'{0}{0}DEFAULT_CHOICES = CHOICES[0][0]',
|
|
61
|
+
'{0}{0}SEARCH_FIELDS = ("id",)',
|
|
62
|
+
'',
|
|
63
|
+
'{0}class _SdcMeta:',
|
|
64
|
+
'{0}{0}"""Meta data information needed to manage all SDC operations."""',
|
|
65
|
+
'{0}{0}edit_form = "{1}.forms.{2}Form"',
|
|
66
|
+
'{0}{0}create_form = "{1}.forms.{2}Form"',
|
|
67
|
+
'{0}{0}html_list_template = "{1}/models/{2}/{2}_list.html"',
|
|
68
|
+
'{0}{0}html_detail_template = "{1}/models/{2}/{2}_details.html"',
|
|
66
69
|
'',
|
|
67
|
-
'{0}@classmethod\n{0}def render(cls, template_name, context=None, request=None, using=None):\n{0}{0}if template_name == cls.html_list_template:\n{0}{0}{0}sf =
|
|
70
|
+
'{0}@classmethod\n{0}def render(cls, template_name, context=None, request=None, using=None):\n{0}{0}if template_name == cls.SdcMeta.html_list_template:\n{0}{0}{0}sf = cls.SearchForm(data=context.get("filter", {{}}))\n{0}{0}{0}context = context | handle_search_form(context["instances"], sf, range=10)\n{0}{0}return render_to_string(template_name=template_name, context=context, request=request, using=using)',
|
|
68
71
|
'',
|
|
69
72
|
'{0}@classmethod\n{0}def is_authorised(cls, user, action, obj):\n{0}{0}return True',
|
|
70
73
|
'',
|
|
@@ -77,8 +77,8 @@ class SettingsManager:
|
|
|
77
77
|
|
|
78
78
|
data = fin.read()
|
|
79
79
|
fin.close()
|
|
80
|
-
data = re.sub(r'(from[^\n]*)', '\g<1>\nimport os\nfrom urllib.parse import urlparse, urlunparse', data)
|
|
81
|
-
data = re.sub(r'(ALLOWED_HOSTS[^\n]*)', '# \g<1>', data)
|
|
80
|
+
data = re.sub(r'(from[^\n]*)', r'\g<1>\nimport os\nfrom urllib.parse import urlparse, urlunparse', data)
|
|
81
|
+
data = re.sub(r'(ALLOWED_HOSTS[^\n]*)', r'# \g<1>', data)
|
|
82
82
|
data = re.sub(r'INSTALLED_APPS\s*=\s*\[[^\]]+\]', new_val, data)
|
|
83
83
|
|
|
84
84
|
new_val = f"DATABASES_AVAILABLE = {{\n{sep}'jest': {{'ENGINE': 'django.db.backends.sqlite3', 'NAME': BASE_DIR / 'test_db.sqlite3', }},"
|
|
@@ -44,26 +44,26 @@ class Command(BaseCommand):
|
|
|
44
44
|
'model_file': os.path.join(options.PROJECT_ROOT, model.__module__.replace('.', os.path.sep) + '.py'),
|
|
45
45
|
'model_file_line': self._get_class_line_number(
|
|
46
46
|
os.path.join(options.PROJECT_ROOT, model.__module__.replace('.', os.path.sep) + '.py'), model.__name__),
|
|
47
|
-
'create_form': self._separate_file_class(model.create_form),
|
|
48
|
-
'edit_form': self._separate_file_class(model.edit_form)
|
|
47
|
+
'create_form': self._separate_file_class(model.SdcMeta.create_form),
|
|
48
|
+
'edit_form': self._separate_file_class(model.SdcMeta.edit_form)
|
|
49
49
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
if model.html_detail_template:
|
|
52
|
+
if model.SdcMeta.html_detail_template:
|
|
53
53
|
try:
|
|
54
|
-
mi['html_detail_template'] = get_template(model.html_detail_template).origin.name
|
|
54
|
+
mi['html_detail_template'] = get_template(model.SdcMeta.html_detail_template).origin.name
|
|
55
55
|
except:
|
|
56
56
|
pass
|
|
57
57
|
|
|
58
|
-
if model.html_list_template:
|
|
58
|
+
if model.SdcMeta.html_list_template:
|
|
59
59
|
try:
|
|
60
|
-
mi['html_list_template'] = get_template(model.html_list_template).origin.name
|
|
60
|
+
mi['html_list_template'] = get_template(model.SdcMeta.html_list_template).origin.name
|
|
61
61
|
except:
|
|
62
62
|
pass
|
|
63
63
|
|
|
64
|
-
if model.html_form_template:
|
|
64
|
+
if model.SdcMeta.html_form_template:
|
|
65
65
|
try:
|
|
66
|
-
mi['html_form_template'] = get_template(model.html_form_template).origin.name
|
|
66
|
+
mi['html_form_template'] = get_template(model.SdcMeta.html_form_template).origin.name
|
|
67
67
|
except:
|
|
68
68
|
pass
|
|
69
69
|
|
{simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/management/commands/sdc_new_model.py
RENAMED
|
@@ -46,7 +46,7 @@ class Command(BaseCommand):
|
|
|
46
46
|
app_name = all_apps[idx]
|
|
47
47
|
model_name = ops.get('model_name')
|
|
48
48
|
if model_name is None:
|
|
49
|
-
text = "Enter the name of the new Model class name (use
|
|
49
|
+
text = "Enter the name of the new Model class name (use CamelCase):"
|
|
50
50
|
model_name = str(input(text))
|
|
51
51
|
|
|
52
52
|
if model_name in [model.__name__ for model in apps.get_app_config(app_name).get_models()]:
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"""
|
|
2
|
+
The SDC package 'sdc_extentions' houses a form called 'AbstractSearchForm' to simplify search implementations.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from django import forms
|
|
6
|
+
from django.utils.translation import gettext_lazy as _
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class AbstractSearchForm(forms.Form):
|
|
10
|
+
"""
|
|
11
|
+
The AbstractSearchForm facilitates the development of a user interface for searching
|
|
12
|
+
entries of a Django model type from the database. This form is closely linked to
|
|
13
|
+
the :func:`sdc_core.sdc_extentions.search.handle_search_form` handler. A form class
|
|
14
|
+
that extends this class is automatically created when you use the sdc management
|
|
15
|
+
command 'sdc_new_model'.
|
|
16
|
+
|
|
17
|
+
The following class properties can be used to customize the search form:
|
|
18
|
+
|
|
19
|
+
:cvar CHOICES: specifies the property according to which the search results are to be sorted.
|
|
20
|
+
The value is a tuple of tuples of human-readable name, property name.
|
|
21
|
+
:cvar DEFAULT_CHOICES: is the name of the property to which the search results are to be sorted if non is selected.
|
|
22
|
+
:cvar SEARCH_FIELDS: is a list or a tuple of names of the properties that are included in the actual search
|
|
23
|
+
:cvar PLACEHOLDER: is the placeholder text in the search input field.
|
|
24
|
+
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
CHOICES: tuple[tuple[str,str]] = ()
|
|
28
|
+
SEARCH_FIELDS: list[str] = []
|
|
29
|
+
DEFAULT_CHOICES: str = ""
|
|
30
|
+
NO_RESULTS_ON_EMPTY_SEARCH = False
|
|
31
|
+
PLACEHOLDER = _('Search')
|
|
32
|
+
search = forms.CharField(label=_('Search'), required=False, max_length=100, initial='')
|
|
33
|
+
order_by = forms.ChoiceField(widget=forms.Select, required=False, choices=CHOICES)
|
|
34
|
+
range_start = forms.IntegerField(widget=forms.HiddenInput(), required=False, initial=0)
|
|
35
|
+
_method = forms.CharField(widget=forms.HiddenInput(), required=True, initial='search')
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def __init__(self, data=None, *args, **kwargs):
|
|
39
|
+
auto_id= self.__class__.__name__ + "_%s"
|
|
40
|
+
if len(data) == 0:
|
|
41
|
+
data = None
|
|
42
|
+
super(AbstractSearchForm, self).__init__(data, auto_id=auto_id, *args, **kwargs)
|
|
43
|
+
self.fields['search'].widget.attrs['placeholder'] = self.PLACEHOLDER
|
|
44
|
+
if len(self.CHOICES) == 0:
|
|
45
|
+
del self.fields["order_by"]
|
|
46
|
+
else:
|
|
47
|
+
self.fields['order_by'].choices = self.CHOICES
|
|
48
|
+
self.fields['order_by'].initial = self.DEFAULT_CHOICES
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import importlib
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def import_function(string_path: str) -> any:
|
|
5
|
+
"""
|
|
6
|
+
Imports a function or a property using a python import sting (path separated by dots)
|
|
7
|
+
|
|
8
|
+
:param string_path: python import sting
|
|
9
|
+
:return: callable function, property or None
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
if string_path is not None:
|
|
13
|
+
p, m = string_path.rsplit('.', 1)
|
|
14
|
+
mod = importlib.import_module(p)
|
|
15
|
+
met = getattr(mod, m)
|
|
16
|
+
return met
|
|
17
|
+
|
|
18
|
+
return None
|
|
@@ -11,11 +11,20 @@ from django.apps import apps
|
|
|
11
11
|
from channels.layers import get_channel_layer
|
|
12
12
|
from django.contrib.auth import get_user_model
|
|
13
13
|
|
|
14
|
+
from sdc_core.sdc_extentions.forms import AbstractSearchForm
|
|
15
|
+
|
|
14
16
|
User = get_user_model()
|
|
15
17
|
|
|
16
18
|
_ALL_MODELS = None
|
|
17
19
|
|
|
18
|
-
|
|
20
|
+
|
|
21
|
+
def all_models() -> dict[str,any]:
|
|
22
|
+
"""
|
|
23
|
+
Collects and returns all SDC Models
|
|
24
|
+
|
|
25
|
+
:return: all SDC models as a dict with keys are model names and the class as value
|
|
26
|
+
"""
|
|
27
|
+
|
|
19
28
|
global _ALL_MODELS
|
|
20
29
|
if _ALL_MODELS is None:
|
|
21
30
|
_ALL_MODELS = {
|
|
@@ -23,7 +32,12 @@ def all_models():
|
|
|
23
32
|
}
|
|
24
33
|
return _ALL_MODELS
|
|
25
34
|
|
|
26
|
-
|
|
35
|
+
|
|
36
|
+
class SDCSerializer(Serializer):
|
|
37
|
+
"""
|
|
38
|
+
The SDCSerializer serializes SdcModels for the API and websocket communication
|
|
39
|
+
|
|
40
|
+
"""
|
|
27
41
|
|
|
28
42
|
def handle_m2m_field(self, obj, field):
|
|
29
43
|
super().handle_m2m_field(obj, field)
|
|
@@ -42,22 +56,78 @@ class ConsumerSerializer(Serializer):
|
|
|
42
56
|
return field.value_from_object(obj).url
|
|
43
57
|
return super()._value_from_field(obj, field)
|
|
44
58
|
|
|
59
|
+
|
|
60
|
+
_SDC_META_DEFAULT = {'edit_form': None,
|
|
61
|
+
'create_form': None,
|
|
62
|
+
'html_list_template': None,
|
|
63
|
+
'html_detail_template': None,
|
|
64
|
+
'html_form_template': getattr(settings, 'MODEL_FORM_TEMPLATE', "elements/form.html")
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
class classproperty(property):
|
|
69
|
+
def __get__(self, obj, objtype=None):
|
|
70
|
+
return super().__get__(objtype)
|
|
71
|
+
|
|
72
|
+
def __set__(self, obj, value):
|
|
73
|
+
super().__set__(type(obj), value)
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
class _SdcMetaDummy:
|
|
77
|
+
_sdc_checked = False
|
|
78
|
+
|
|
79
|
+
|
|
45
80
|
class SdcModel():
|
|
81
|
+
"""
|
|
82
|
+
A Django Model which also extents the SdcModel class can be used as a Websocked based Client Model.
|
|
83
|
+
Use the SDC management command new_model to create a new model class.
|
|
84
|
+
"""
|
|
85
|
+
|
|
46
86
|
__is_sdc_model__ = True
|
|
47
|
-
edit_form = None
|
|
48
|
-
create_form = None
|
|
49
|
-
html_list_template = None
|
|
50
|
-
html_detail_template = None
|
|
51
|
-
html_form_template = getattr(settings, 'MODEL_FORM_TEMPLATE', "elements/form.html")
|
|
52
|
-
apply_filter = None
|
|
53
87
|
_scope = None
|
|
54
88
|
|
|
89
|
+
class SearchForm(AbstractSearchForm):
|
|
90
|
+
CHOICES = (("id", "Id"),)
|
|
91
|
+
PLACEHOLDER = ""
|
|
92
|
+
DEFAULT_CHOICES = CHOICES[0][0]
|
|
93
|
+
SEARCH_FIELDS = ("id",)
|
|
94
|
+
|
|
95
|
+
@classproperty
|
|
96
|
+
def SdcMeta(cls):
|
|
97
|
+
"""
|
|
98
|
+
SdcMeta is a metaclass that contains all the
|
|
99
|
+
important metadata for rendering HTML views of instances.
|
|
100
|
+
All class variable are python import sting
|
|
101
|
+
|
|
102
|
+
:cvar edit_form: Import string to edit form class
|
|
103
|
+
:cvar create_form: Import string to edit form class
|
|
104
|
+
:cvar forms: Import string to edit form class
|
|
105
|
+
|
|
106
|
+
"""
|
|
107
|
+
if not hasattr(cls, '_SdcMeta'):
|
|
108
|
+
setattr(cls, '_SdcMeta', _SdcMetaDummy())
|
|
109
|
+
|
|
110
|
+
sdc_meta = getattr(cls, '_SdcMeta')
|
|
111
|
+
|
|
112
|
+
if not getattr(sdc_meta, '_sdc_checked', False):
|
|
113
|
+
setattr(sdc_meta, '_sdc_checked', True)
|
|
114
|
+
for k, v in _SDC_META_DEFAULT.items():
|
|
115
|
+
if not hasattr(sdc_meta, k):
|
|
116
|
+
setattr(sdc_meta, k, getattr(cls, k, v))
|
|
117
|
+
return sdc_meta
|
|
118
|
+
|
|
55
119
|
@property
|
|
56
120
|
def scope(self) -> dict[str: any]:
|
|
121
|
+
"""
|
|
122
|
+
:return: Websocket scope object
|
|
123
|
+
"""
|
|
57
124
|
return self._scope
|
|
58
125
|
|
|
59
126
|
@scope.setter
|
|
60
127
|
def scope(self, scope: dict[str: any]):
|
|
128
|
+
"""
|
|
129
|
+
Set the Websocket scope object
|
|
130
|
+
"""
|
|
61
131
|
self._scope = scope
|
|
62
132
|
|
|
63
133
|
@classmethod
|
|
@@ -73,15 +143,24 @@ class SdcModel():
|
|
|
73
143
|
raise NotImplemented
|
|
74
144
|
|
|
75
145
|
@classmethod
|
|
76
|
-
def data_load(cls, user: User, action: str, obj: dict[str: any]) -> QuerySet|None:
|
|
146
|
+
def data_load(cls, user: User, action: str, obj: dict[str: any]) -> QuerySet | None:
|
|
77
147
|
return None
|
|
78
148
|
|
|
79
149
|
|
|
80
150
|
@receiver(post_save) # instead of @receiver(post_save, sender=Rebel)
|
|
81
151
|
@receiver(post_delete) # instead of @receiver(post_save, sender=Rebel)
|
|
82
|
-
def set_winner(sender, instance=None, created=False, **kwargs):
|
|
152
|
+
def set_winner(sender, instance=None, created: bool = False, **kwargs):
|
|
153
|
+
"""
|
|
154
|
+
Handles the client notification if an SDC model has been saved, created or deleted.
|
|
155
|
+
|
|
156
|
+
:param sender: The modul class
|
|
157
|
+
:param instance: Saved, created or deleted instance
|
|
158
|
+
:param created: True if instance has no db id before it has been saved
|
|
159
|
+
:param kwargs:
|
|
160
|
+
"""
|
|
161
|
+
|
|
83
162
|
if instance is not None and hasattr(sender, '__is_sdc_model__'):
|
|
84
|
-
serialize_instance =
|
|
163
|
+
serialize_instance = SDCSerializer().serialize([instance])
|
|
85
164
|
if created:
|
|
86
165
|
async_to_sync(get_channel_layer().group_send)(sender.__name__, {
|
|
87
166
|
'event_id': 'none',
|
|
@@ -5,13 +5,12 @@ from django.http import HttpResponse
|
|
|
5
5
|
from django.template.loader import render_to_string
|
|
6
6
|
from django.core.serializers.json import DjangoJSONEncoder
|
|
7
7
|
|
|
8
|
-
|
|
9
8
|
NEXT = 'next_controller'
|
|
10
9
|
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
def sdc_link_factory(controller: str = None, link_data: dict = None, add_sdc_index : bool = True) -> str:
|
|
11
|
+
def sdc_link_factory(controller: str = None, link_data: dict = None, add_sdc_index: bool = True) -> str:
|
|
14
12
|
"""
|
|
13
|
+
|
|
15
14
|
:param controller: path to controller
|
|
16
15
|
:type controller: str, optional
|
|
17
16
|
:param link_data: arguments passed to the new redirected controller
|
|
@@ -51,16 +50,14 @@ def send_redirect(controller: str = None, back: bool = False, link_data: dict =
|
|
|
51
50
|
send_redirect is a simple way to redirect a client to another SDC controller. Set the controller argument according to
|
|
52
51
|
the rules of the sdc_tools.sdc_navigator. Following you see some examples:
|
|
53
52
|
|
|
54
|
-
|
|
55
53
|
- /view-a/view-b -> view-b as subview of view-a
|
|
56
54
|
- */view-b -> keeps first view as it is and view-b as subview
|
|
57
55
|
- ../view-b -> replaces current latest subview by view-b
|
|
58
56
|
- ./view-b -> adds view-b as next latest subview to the current path
|
|
59
57
|
|
|
60
|
-
|
|
61
58
|
:param controller: path to controller
|
|
62
59
|
:type controller: str, optional
|
|
63
|
-
:param back: if
|
|
60
|
+
:param back: if ``True`` the redirect url is equal to ``..``, default is ``False``
|
|
64
61
|
:type back: boolean, optional
|
|
65
62
|
:param link_data: arguments passed to the new redirected controller
|
|
66
63
|
:type link_data: dict, optional
|
|
@@ -86,7 +83,7 @@ def send_redirect(controller: str = None, back: bool = False, link_data: dict =
|
|
|
86
83
|
return HttpResponse(json.dumps(kwargs, cls=DjangoJSONEncoder), status=301, content_type="application/json")
|
|
87
84
|
|
|
88
85
|
|
|
89
|
-
def send_success(template_name: str = None, context: dict = None, request
|
|
86
|
+
def send_success(template_name: str = None, context: dict = None, request=None, status='success', **kwargs):
|
|
90
87
|
"""
|
|
91
88
|
|
|
92
89
|
:param template_name: HTML template name
|
|
@@ -110,5 +107,6 @@ def send_error(template_name: str = None, context: dict = None, request=None, st
|
|
|
110
107
|
kwargs['html'] = render_to_string(template_name, request=request, context=context)
|
|
111
108
|
return HttpResponse(json.dumps(kwargs, cls=DjangoJSONEncoder), status=status, content_type="application/json")
|
|
112
109
|
|
|
110
|
+
|
|
113
111
|
def send_controller(controller_name: str):
|
|
114
|
-
return HttpResponse('<%s></%s>' % (controller_name,controller_name), content_type="text/html")
|
|
112
|
+
return HttpResponse('<%s></%s>' % (controller_name, controller_name), content_type="text/html")
|
|
@@ -1,11 +1,21 @@
|
|
|
1
|
-
from django.db.models import Q
|
|
1
|
+
from django.db.models import Q, QuerySet
|
|
2
|
+
from sdc_core.sdc_extentions.forms import AbstractSearchForm
|
|
2
3
|
|
|
3
|
-
def
|
|
4
|
+
def _generate_q_key_value_request(key, val):
|
|
4
5
|
map_val = {key + '__icontains': val}
|
|
5
6
|
return Q(**map_val)
|
|
6
7
|
|
|
7
8
|
|
|
8
|
-
def handle_search_form(query_set, search_form, filter_dict=None, range=0):
|
|
9
|
+
def handle_search_form(query_set: QuerySet, search_form: AbstractSearchForm, filter_dict: dict=None, range: int=0):
|
|
10
|
+
"""
|
|
11
|
+
This handler function takes a :class:`sdc_core.sdc_extentions.forms.AbstractSearchForm`
|
|
12
|
+
|
|
13
|
+
:param query_set:
|
|
14
|
+
:param search_form:
|
|
15
|
+
:param filter_dict:
|
|
16
|
+
:param range:
|
|
17
|
+
:return:
|
|
18
|
+
"""
|
|
9
19
|
if not search_form.is_valid():
|
|
10
20
|
data = {}
|
|
11
21
|
else:
|
|
@@ -26,9 +36,9 @@ def handle_search_form(query_set, search_form, filter_dict=None, range=0):
|
|
|
26
36
|
q_list = None
|
|
27
37
|
for key in search_form.SEARCH_FIELDS:
|
|
28
38
|
if q_list is None:
|
|
29
|
-
q_list =
|
|
39
|
+
q_list = _generate_q_key_value_request(key, key_word)
|
|
30
40
|
else:
|
|
31
|
-
q_list = q_list |
|
|
41
|
+
q_list = q_list | _generate_q_key_value_request(key, key_word)
|
|
32
42
|
query_set = query_set.filter(q_list).distinct()
|
|
33
43
|
query_set_count = query_set.count()
|
|
34
44
|
elif(search_form.NO_RESULTS_ON_EMPTY_SEARCH):
|
{simpledomcontrol-0.55.4 → simpledomcontrol-0.56.1}/sdc_core/template_files/Assets/gulpfile.jsx
RENAMED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
const {src, dest, series, parallel} = require('gulp');
|
|
4
|
-
const path = require("path");
|
|
5
4
|
const webpack = require('webpack-stream');
|
|
5
|
+
const copy = require('gulp-copy');
|
|
6
|
+
|
|
7
|
+
process.env.JS_CILENT_FILE_EXTENTIONS = ['.js', '.json'];
|
|
6
8
|
|
|
7
9
|
const {
|
|
8
10
|
sdc_scss,
|
|
@@ -20,11 +22,20 @@ function webpack_javascript() {
|
|
|
20
22
|
.pipe(dest('../static'));
|
|
21
23
|
}
|
|
22
24
|
|
|
25
|
+
function copy_statics() {
|
|
26
|
+
return src('./static/**/*')
|
|
27
|
+
.pipe(copy('../static', { prefix: 1 }))
|
|
28
|
+
.on('end', () => {
|
|
29
|
+
console.log('Contents copied successfully!');
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
|
|
23
33
|
exports.webpack = webpack_javascript;
|
|
24
34
|
exports.scss = sdc_scss;
|
|
25
35
|
exports.link_files = sdc_link_files;
|
|
26
36
|
exports.clean = sdc_clean;
|
|
27
|
-
exports.
|
|
37
|
+
exports.copy_statics = copy_statics;
|
|
38
|
+
exports.default = series(copy_statics, sdc_default_build_factory(webpack_javascript));
|
|
28
39
|
exports.watch_scss = sdc_watch_scss;
|
|
29
40
|
exports.watch_webpack = sdc_watch_webpack_factory(webpack_javascript);
|
|
30
41
|
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
@import "
|
|
1
|
+
@import "../../node_modules/bootstrap/dist/css/bootstrap";
|
|
2
2
|
@import "./sdc_user/sdc_user.style";
|
|
3
3
|
@import "./sdc_tools/sdc_tools.style";
|
|
4
4
|
|
|
5
|
+
body::before {
|
|
6
|
+
content: "SDC Works";
|
|
7
|
+
font-size: larger;
|
|
8
|
+
color: red;
|
|
9
|
+
}
|
|
10
|
+
|
|
5
11
|
body {
|
|
6
12
|
background-color: cornflowerblue;
|
|
7
13
|
|
|
8
|
-
::before {
|
|
9
|
-
content: "SDC Works";
|
|
10
|
-
font-size: larger;
|
|
11
|
-
color: red;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
14
|
.navbar-dummy {
|
|
15
15
|
height: 70px;
|
|
16
16
|
}
|
|
17
|
-
}
|
|
17
|
+
}
|
|
@@ -7,12 +7,26 @@ class §CONTROLLERNAMETITLE§Controller extends AbstractSDC {
|
|
|
7
7
|
super();
|
|
8
8
|
this.contentUrl = "§TEMPLATEURL§"; //§TAGNAME§
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* Uncomment the following line to make sure the HTML template
|
|
12
|
+
* of this controller is not cached and reloaded for every instance
|
|
13
|
+
* of this controller.
|
|
14
|
+
*/
|
|
15
|
+
// this.contentReload = true;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Uncomment the following line to make this controller asynchronous.
|
|
19
|
+
* This means that the parent controller finishes loading without
|
|
20
|
+
* waiting for this controller
|
|
21
|
+
*/
|
|
22
|
+
// this.load_async = true;
|
|
23
|
+
|
|
10
24
|
/**
|
|
11
25
|
* Events is an array of dom events.
|
|
12
26
|
* The pattern is {'event': {'dom_selector': handler}}
|
|
13
|
-
*
|
|
27
|
+
* Uncomment the following line to add events;
|
|
14
28
|
*/
|
|
15
|
-
// this.events.unshift({'click': {'.header-sample': (ev, $elem)=> $elem.css('border', '2px solid black')}}
|
|
29
|
+
// this.events.unshift({'click': {'.header-sample': (ev, $elem)=> $elem.css('border', '2px solid black')}});
|
|
16
30
|
}
|
|
17
31
|
|
|
18
32
|
//-------------------------------------------------//
|