SimpleDomControl 0.56.0__tar.gz → 0.56.2__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.
Files changed (132) hide show
  1. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/PKG-INFO +5 -4
  2. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/pyproject.toml +5 -4
  3. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/consumers.py +6 -5
  4. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/management/commands/init_add/settings_manager.py +2 -2
  5. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/management/commands/sdc_new_model.py +1 -1
  6. simpledomcontrol-0.56.2/sdc_core/sdc_extentions/forms.py +48 -0
  7. simpledomcontrol-0.56.2/sdc_core/sdc_extentions/import_manager.py +18 -0
  8. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/sdc_extentions/models.py +49 -5
  9. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/sdc_extentions/search.py +15 -5
  10. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/template_files/Assets/src/index.style.scss +8 -8
  11. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/template_files/package.json +4 -3
  12. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_tools/Assets/src/sdc_tools/controller/sdc_search_view/sdc_search_view.js +1 -1
  13. simpledomcontrol-0.56.0/sdc_core/sdc_extentions/forms.py +0 -26
  14. simpledomcontrol-0.56.0/sdc_core/sdc_extentions/import_manager.py +0 -18
  15. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/README.md +0 -0
  16. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/__init__.py +0 -0
  17. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/apps.py +0 -0
  18. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/management/__init__.py +0 -0
  19. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/management/commands/__init__.py +0 -0
  20. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/management/commands/_private.py +0 -0
  21. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/management/commands/init_add/__init__.py +0 -0
  22. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/management/commands/init_add/add_controller_manager.py +0 -0
  23. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/management/commands/init_add/add_model_manager.py +0 -0
  24. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/management/commands/init_add/options.py +0 -0
  25. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/management/commands/init_add/sdc_core_manager.py +0 -0
  26. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/management/commands/init_add/utils.py +0 -0
  27. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/management/commands/sdc_cc.py +0 -0
  28. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/management/commands/sdc_get_controller_infos.py +0 -0
  29. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/management/commands/sdc_get_controller_url.py +0 -0
  30. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/management/commands/sdc_get_model_infos.py +0 -0
  31. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/management/commands/sdc_init.py +0 -0
  32. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/management/commands/sdc_is_installed.py +0 -0
  33. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/management/commands/sdc_shell_execute_script.py +0 -0
  34. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/management/commands/sdc_update_links.py +0 -0
  35. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/management/commands/sdc_update_url.py +0 -0
  36. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/sdc_extentions/__init__.py +0 -0
  37. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/sdc_extentions/response.py +0 -0
  38. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/sdc_extentions/views.py +0 -0
  39. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/template_files/Assets/.babelrc +0 -0
  40. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/template_files/Assets/gulpfile.jsx +0 -0
  41. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/template_files/Assets/src/index.organizer.js +0 -0
  42. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/template_files/Assets/tests/config/post-test-teardown.js +0 -0
  43. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/template_files/Assets/tests/config/pre-test-setup.js +0 -0
  44. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/template_files/Assets/tests/config/test-setup.js +0 -0
  45. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/template_files/Assets/webpack.config/webpack.default.config.jsx +0 -0
  46. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/template_files/Assets/webpack.config/webpack.development.config.jsx +0 -0
  47. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/template_files/Assets/webpack.config/webpack.production.config.jsx +0 -0
  48. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/template_files/apps/sdc_examples/Add_SDCUser.txt +0 -0
  49. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/template_files/apps/sdc_examples/index.html +0 -0
  50. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/template_files/apps/sdc_examples/server_call.txt +0 -0
  51. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/template_files/asgi.py.txt +0 -0
  52. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/template_files/controller/templade_view.html +0 -0
  53. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/template_files/controller/template_controller.js.txt +0 -0
  54. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/template_files/controller/template_css.scss +0 -0
  55. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/template_files/controller/template_test.js.text +0 -0
  56. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/template_files/js_test.js.txt +0 -0
  57. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/template_files/models/detail.html +0 -0
  58. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/template_files/models/list.html +0 -0
  59. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/template_files/routing.py.txt +0 -0
  60. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/template_files/sdc_urls.py.txt +0 -0
  61. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/template_files/sdc_views.py.txt +0 -0
  62. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/template_files/settings_extension.py.txt +0 -0
  63. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/template_files/templates/base.html +0 -0
  64. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/template_files/templates/index.html +0 -0
  65. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_core/template_files/urls.py.txt +0 -0
  66. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_tools/Assets/src/sdc_tools/controller/sdc_alert_messenger/sdc_alert_messenger.js +0 -0
  67. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_tools/Assets/src/sdc_tools/controller/sdc_alert_messenger/sdc_alert_messenger.scss +0 -0
  68. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_tools/Assets/src/sdc_tools/controller/sdc_auto_submit/sdc_auto_submit.js +0 -0
  69. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_tools/Assets/src/sdc_tools/controller/sdc_detail_view/sdc_detail_view.js +0 -0
  70. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_tools/Assets/src/sdc_tools/controller/sdc_detail_view/sdc_detail_view.scss +0 -0
  71. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_tools/Assets/src/sdc_tools/controller/sdc_dummy/sdc_dummy.js +0 -0
  72. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_tools/Assets/src/sdc_tools/controller/sdc_dummy/sdc_dummy.scss +0 -0
  73. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_tools/Assets/src/sdc_tools/controller/sdc_error/sdc_error.js +0 -0
  74. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_tools/Assets/src/sdc_tools/controller/sdc_error/sdc_error.scss +0 -0
  75. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_tools/Assets/src/sdc_tools/controller/sdc_list_view/sdc_list_view.js +0 -0
  76. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_tools/Assets/src/sdc_tools/controller/sdc_list_view/sdc_list_view.scss +0 -0
  77. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_tools/Assets/src/sdc_tools/controller/sdc_model_form/sdc_model_form.js +0 -0
  78. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_tools/Assets/src/sdc_tools/controller/sdc_model_form/sdc_model_form.scss +0 -0
  79. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_tools/Assets/src/sdc_tools/controller/sdc_navigation_client/sdc_navigation_client.js +0 -0
  80. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_tools/Assets/src/sdc_tools/controller/sdc_navigator/sdc_navigator.js +0 -0
  81. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_tools/Assets/src/sdc_tools/controller/sdc_navigator/sdc_navigator.scss +0 -0
  82. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_tools/Assets/src/sdc_tools/controller/sdc_search_view/sdc_search_view.scss +0 -0
  83. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_tools/Assets/src/sdc_tools/controller/sdc_update_on_change/sdc_update_on_change.js +0 -0
  84. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_tools/Assets/src/sdc_tools/sdc_tools.organizer.js +0 -0
  85. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_tools/Assets/src/sdc_tools/sdc_tools.style.scss +0 -0
  86. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_tools/Assets/tests/sdc_tools.test.js +0 -0
  87. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_tools/__init__.py +0 -0
  88. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_tools/admin.py +0 -0
  89. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_tools/apps.py +0 -0
  90. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_tools/migrations/__init__.py +0 -0
  91. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_tools/models.py +0 -0
  92. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_tools/sdc_urls.py +0 -0
  93. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_tools/sdc_views.py +0 -0
  94. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_tools/templates/elements/form.html +0 -0
  95. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_tools/templates/elements/inline_form.html +0 -0
  96. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_tools/templates/email/base.html +0 -0
  97. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_tools/templates/sdc_tools/sdc/dummy_sdc.html +0 -0
  98. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_tools/templates/sdc_tools/sdc/sdc_alert_messenger.html +0 -0
  99. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_tools/templates/sdc_tools/sdc/sdc_detail_view.html +0 -0
  100. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_tools/templates/sdc_tools/sdc/sdc_dummy.html +0 -0
  101. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_tools/templates/sdc_tools/sdc/sdc_error.html +0 -0
  102. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_tools/templates/sdc_tools/sdc/sdc_list_view.html +0 -0
  103. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_tools/templates/sdc_tools/sdc/sdc_model_form.html +0 -0
  104. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_tools/templates/sdc_tools/sdc/sdc_navigator.html +0 -0
  105. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_tools/templates/sdc_tools/sdc/sdc_search_view.html +0 -0
  106. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_tools/templatetags/__init__.py +0 -0
  107. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_tools/templatetags/addclass.py +0 -0
  108. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_tools/templatetags/indexfilter.py +0 -0
  109. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_tools/templatetags/sdc_filter.py +0 -0
  110. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_tools/tests.py +0 -0
  111. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_tools/views.py +0 -0
  112. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_user/Assets/src/sdc_user/controller/sdc_login/sdc_login.js +0 -0
  113. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_user/Assets/src/sdc_user/controller/sdc_login/sdc_login.scss +0 -0
  114. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_user/Assets/src/sdc_user/controller/sdc_logout/sdc_logout.js +0 -0
  115. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_user/Assets/src/sdc_user/controller/sdc_logout/sdc_logout.scss +0 -0
  116. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_user/Assets/src/sdc_user/controller/sdc_user_nav_btn/sdc_user_nav_btn.js +0 -0
  117. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_user/Assets/src/sdc_user/controller/sdc_user_nav_btn/sdc_user_nav_btn.scss +0 -0
  118. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_user/Assets/src/sdc_user/sdc_user.organizer.js +0 -0
  119. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_user/Assets/src/sdc_user/sdc_user.style.scss +0 -0
  120. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_user/Assets/tests/sdc_user.test.js +0 -0
  121. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_user/__init__.py +0 -0
  122. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_user/admin.py +0 -0
  123. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_user/apps.py +0 -0
  124. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_user/migrations/__init__.py +0 -0
  125. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_user/models.py +0 -0
  126. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_user/sdc_urls.py +0 -0
  127. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_user/sdc_views.py +0 -0
  128. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_user/templates/sdc_user/sdc/sdc_login.html +0 -0
  129. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_user/templates/sdc_user/sdc/sdc_logout.html +0 -0
  130. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_user/templates/sdc_user/sdc/sdc_user_nav_btn.html +0 -0
  131. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_user/tests.py +0 -0
  132. {simpledomcontrol-0.56.0 → simpledomcontrol-0.56.2}/sdc_user/views.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: SimpleDomControl
3
- Version: 0.56.0
3
+ Version: 0.56.2
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,13 +17,14 @@ 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 (>=23.2.0,<24.0.0)
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.0.6,<6.0.0)
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.5.15,<2025.0.0)
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)
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "SimpleDomControl"
3
- version = "0.56.0"
3
+ version = "0.56.2"
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.0.6"
25
+ django = "^5.1.2"
26
26
  psycopg2-binary = "^2.9.9"
27
- attrs = "^23.2.0"
28
- regex = "^2024.5.15"
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 = [
@@ -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, ConsumerSerializer, all_models
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
@@ -179,9 +179,9 @@ class SDCModelConsumer(WebsocketConsumer):
179
179
  self.queryset = {}
180
180
  self.model_id_list = []
181
181
  self._upload_handler = {}
182
+ self._group_names = []
182
183
 
183
184
  def connect(self):
184
-
185
185
  self.model_name = self.scope['url_route']['kwargs']['model_name']
186
186
  self.model = ALL_MODELS.get(self.model_name)
187
187
  if self.model is None or not hasattr(self.model, '__is_sdc_model__'):
@@ -191,7 +191,8 @@ class SDCModelConsumer(WebsocketConsumer):
191
191
  self.accept()
192
192
 
193
193
  def disconnect(self, close_code):
194
- pass
194
+ for group in self._group_names:
195
+ async_to_sync(self.channel_layer.group_discard( group, self.channel_name ))
195
196
 
196
197
  def on_update(self, data):
197
198
  if data['pk'] in self.ids:
@@ -248,7 +249,7 @@ class SDCModelConsumer(WebsocketConsumer):
248
249
  elif event_type == 'model_delete':
249
250
  self._delete_element(json_data)
250
251
  elif event_type == 'model_load':
251
- model_data = ConsumerSerializer().serialize(self._load_model())
252
+ model_data = SDCSerializer().serialize(self._load_model())
252
253
  self.send(text_data=json.dumps({
253
254
  'type': json_data['event_type'],
254
255
  'event_id': json_data['event_id'],
@@ -406,7 +407,7 @@ class SDCModelConsumer(WebsocketConsumer):
406
407
 
407
408
  if is_valid:
408
409
  form_instance.save()
409
- new_instance = ConsumerSerializer().serialize(self._load_model().filter(pk=form_instance.instance.pk))
410
+ new_instance = SDCSerializer().serialize(self._load_model().filter(pk=form_instance.instance.pk))
410
411
  msg = self.msg_manager.get_msg(form_instance.instance, json_data['event_type'])
411
412
  else:
412
413
  msg = {'header': 'Upss!',
@@ -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', }},"
@@ -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 camel-case):"
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
@@ -18,7 +18,13 @@ User = get_user_model()
18
18
  _ALL_MODELS = None
19
19
 
20
20
 
21
- def all_models():
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
+
22
28
  global _ALL_MODELS
23
29
  if _ALL_MODELS is None:
24
30
  _ALL_MODELS = {
@@ -27,7 +33,11 @@ def all_models():
27
33
  return _ALL_MODELS
28
34
 
29
35
 
30
- class ConsumerSerializer(Serializer):
36
+ class SDCSerializer(Serializer):
37
+ """
38
+ The SDCSerializer serializes SdcModels for the API and websocket communication
39
+
40
+ """
31
41
 
32
42
  def handle_m2m_field(self, obj, field):
33
43
  super().handle_m2m_field(obj, field)
@@ -54,16 +64,25 @@ _SDC_META_DEFAULT = {'edit_form': None,
54
64
  'html_form_template': getattr(settings, 'MODEL_FORM_TEMPLATE', "elements/form.html")
55
65
  }
56
66
 
67
+
57
68
  class classproperty(property):
58
69
  def __get__(self, obj, objtype=None):
59
70
  return super().__get__(objtype)
71
+
60
72
  def __set__(self, obj, value):
61
73
  super().__set__(type(obj), value)
62
74
 
75
+
63
76
  class _SdcMetaDummy:
64
77
  _sdc_checked = False
65
78
 
79
+
66
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
+
67
86
  __is_sdc_model__ = True
68
87
  _scope = None
69
88
 
@@ -75,13 +94,23 @@ class SdcModel():
75
94
 
76
95
  @classproperty
77
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
+ """
78
107
  if not hasattr(cls, '_SdcMeta'):
79
108
  setattr(cls, '_SdcMeta', _SdcMetaDummy())
80
109
 
81
110
  sdc_meta = getattr(cls, '_SdcMeta')
82
111
 
83
112
  if not getattr(sdc_meta, '_sdc_checked', False):
84
- setattr(sdc_meta,'_sdc_checked', True)
113
+ setattr(sdc_meta, '_sdc_checked', True)
85
114
  for k, v in _SDC_META_DEFAULT.items():
86
115
  if not hasattr(sdc_meta, k):
87
116
  setattr(sdc_meta, k, getattr(cls, k, v))
@@ -89,10 +118,16 @@ class SdcModel():
89
118
 
90
119
  @property
91
120
  def scope(self) -> dict[str: any]:
121
+ """
122
+ :return: Websocket scope object
123
+ """
92
124
  return self._scope
93
125
 
94
126
  @scope.setter
95
127
  def scope(self, scope: dict[str: any]):
128
+ """
129
+ Set the Websocket scope object
130
+ """
96
131
  self._scope = scope
97
132
 
98
133
  @classmethod
@@ -114,9 +149,18 @@ class SdcModel():
114
149
 
115
150
  @receiver(post_save) # instead of @receiver(post_save, sender=Rebel)
116
151
  @receiver(post_delete) # instead of @receiver(post_save, sender=Rebel)
117
- 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
+
118
162
  if instance is not None and hasattr(sender, '__is_sdc_model__'):
119
- serialize_instance = ConsumerSerializer().serialize([instance])
163
+ serialize_instance = SDCSerializer().serialize([instance])
120
164
  if created:
121
165
  async_to_sync(get_channel_layer().group_send)(sender.__name__, {
122
166
  'event_id': 'none',
@@ -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 generate_q_key_value_request(key, val):
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 = generate_q_key_value_request(key, key_word)
39
+ q_list = _generate_q_key_value_request(key, key_word)
30
40
  else:
31
- q_list = q_list | generate_q_key_value_request(key, key_word)
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):
@@ -1,17 +1,17 @@
1
- @import "../node_modules/bootstrap/scss/bootstrap";
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
+ }
@@ -50,6 +50,7 @@
50
50
  "glob-watcher": "^6.0.0",
51
51
  "gulp": "^4.0.2",
52
52
  "gulp-clean": "^0.4.0",
53
+ "gulp-copy": "^4.0.1",
53
54
  "gulp-exec": "^5.0.0",
54
55
  "gulp-rename": "^2.0.0",
55
56
  "gulp-sass": "^5.1.0",
@@ -57,12 +58,12 @@
57
58
  "jest": "^29.7.0",
58
59
  "jest-environment-jsdom": "^29.7.0",
59
60
  "js-cookie": "^3.0.5",
60
- "micromatch": "^4.0.6",
61
+ "micromatch": "^4.0.8",
61
62
  "sass": "^1.69.7",
62
63
  "sass-loader": "^13.3.3",
63
64
  "style-loader": "^3.3.4",
64
65
  "terser-webpack-plugin": "^5.3.10",
65
- "webpack": "^5.89.0",
66
+ "webpack": "^5.95.0",
66
67
  "webpack-stream": "^7.0.0"
67
68
  },
68
69
  "overrides": {
@@ -75,6 +76,6 @@
75
76
  "esm": "^3.2.25",
76
77
  "jquery": "^3.7.0",
77
78
  "lodash": "^4.17.21",
78
- "sdc_client": "^0.56.0"
79
+ "sdc_client": "^0.56.2"
79
80
  }
80
81
  }
@@ -84,7 +84,7 @@ export class SdcSearchViewController extends AbstractSDC {
84
84
 
85
85
  if (!this.isRange) {
86
86
  $pageContainer.remove();
87
- return;
87
+ return super.willShow();
88
88
  }
89
89
 
90
90
  $pageContainer.find('.range-span').text(this.range[1] + ' - ' + this.range[2]);
@@ -1,26 +0,0 @@
1
- from django import forms
2
- from django.utils.translation import gettext_lazy as _
3
-
4
- class AbstractSearchForm(forms.Form):
5
- CHOICES = ()
6
- SEARCH_FIELDS = ()
7
- DEFAULT_CHOICES = ""
8
- NO_RESULTS_ON_EMPTY_SEARCH = False
9
- PLACEHOLDER = _('Search')
10
- search = forms.CharField(label=_('Search'), required=False, max_length=100, initial='')
11
- order_by = forms.ChoiceField(widget=forms.Select, required=False, choices=CHOICES)
12
- range_start = forms.IntegerField(widget=forms.HiddenInput(), required=False, initial=0)
13
- _method = forms.CharField(widget=forms.HiddenInput(), required=True, initial='search')
14
-
15
-
16
- def __init__(self, data=None, *args, **kwargs):
17
- auto_id= self.__class__.__name__ + "_%s"
18
- if len(data) == 0:
19
- data = None
20
- super(AbstractSearchForm, self).__init__(data, auto_id=auto_id, *args, **kwargs)
21
- self.fields['search'].widget.attrs['placeholder'] = self.PLACEHOLDER
22
- if len(self.CHOICES) == 0:
23
- del self.fields["order_by"]
24
- else:
25
- self.fields['order_by'].choices = self.CHOICES
26
- self.fields['order_by'].initial = self.DEFAULT_CHOICES
@@ -1,18 +0,0 @@
1
- import importlib
2
-
3
-
4
- def import_function(string_path):
5
- if string_path is not None:
6
- p, m = string_path.rsplit('.', 1)
7
- mod = importlib.import_module(p)
8
- met = getattr(mod, m)
9
- return met
10
-
11
-
12
- return None
13
-
14
- def import_functions(func_map):
15
- if func_map == None:
16
- return
17
- for key in func_map:
18
- yield key, import_function(func_map[key])