palm-django 0.8.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.
Files changed (62) hide show
  1. palm_django-0.8.0/.gitignore +234 -0
  2. palm_django-0.8.0/CHANGELOG.md +41 -0
  3. palm_django-0.8.0/LICENSE +21 -0
  4. palm_django-0.8.0/PKG-INFO +552 -0
  5. palm_django-0.8.0/README.md +511 -0
  6. palm_django-0.8.0/palm_django/__init__.py +96 -0
  7. palm_django-0.8.0/palm_django/_django_compat.py +15 -0
  8. palm_django-0.8.0/palm_django/admin.py +113 -0
  9. palm_django-0.8.0/palm_django/apps.py +43 -0
  10. palm_django-0.8.0/palm_django/backends.py +176 -0
  11. palm_django-0.8.0/palm_django/checks.py +60 -0
  12. palm_django-0.8.0/palm_django/discovery.py +128 -0
  13. palm_django-0.8.0/palm_django/doctor.py +244 -0
  14. palm_django-0.8.0/palm_django/management/__init__.py +0 -0
  15. palm_django-0.8.0/palm_django/management/commands/__init__.py +0 -0
  16. palm_django-0.8.0/palm_django/management/commands/palm.py +331 -0
  17. palm_django-0.8.0/palm_django/management/palm_cli.py +82 -0
  18. palm_django-0.8.0/palm_django/management/quickstart.py +137 -0
  19. palm_django-0.8.0/palm_django/management/server.py +78 -0
  20. palm_django-0.8.0/palm_django/migrations/0001_initial.py +62 -0
  21. palm_django-0.8.0/palm_django/migrations/__init__.py +0 -0
  22. palm_django-0.8.0/palm_django/models.py +80 -0
  23. palm_django-0.8.0/palm_django/providers/__init__.py +7 -0
  24. palm_django-0.8.0/palm_django/providers/provider.py +271 -0
  25. palm_django-0.8.0/palm_django/providers/registry.py +25 -0
  26. palm_django-0.8.0/palm_django/resources/__init__.py +31 -0
  27. palm_django-0.8.0/palm_django/resources/base.py +28 -0
  28. palm_django-0.8.0/palm_django/resources/config.py +61 -0
  29. palm_django-0.8.0/palm_django/resources/decorator.py +53 -0
  30. palm_django-0.8.0/palm_django/resources/registry.py +133 -0
  31. palm_django-0.8.0/palm_django/resources/schema.py +342 -0
  32. palm_django-0.8.0/palm_django/resources/serializer.py +42 -0
  33. palm_django-0.8.0/palm_django/runtime.py +170 -0
  34. palm_django-0.8.0/palm_django/settings.py +142 -0
  35. palm_django-0.8.0/palm_django/signals.py +80 -0
  36. palm_django-0.8.0/palm_django/storage_keys.py +46 -0
  37. palm_django-0.8.0/palm_django/storages/__init__.py +9 -0
  38. palm_django-0.8.0/palm_django/storages/registry.py +26 -0
  39. palm_django-0.8.0/palm_django/transactions.py +53 -0
  40. palm_django-0.8.0/pyproject.toml +100 -0
  41. palm_django-0.8.0/tests/__init__.py +0 -0
  42. palm_django-0.8.0/tests/conftest.py +14 -0
  43. palm_django-0.8.0/tests/palm_sample/__init__.py +0 -0
  44. palm_django-0.8.0/tests/palm_sample/apps.py +6 -0
  45. palm_django-0.8.0/tests/palm_sample/migrations/0001_initial.py +29 -0
  46. palm_django-0.8.0/tests/palm_sample/migrations/0002_schemaitem.py +19 -0
  47. palm_django-0.8.0/tests/palm_sample/migrations/__init__.py +0 -0
  48. palm_django-0.8.0/tests/palm_sample/models.py +35 -0
  49. palm_django-0.8.0/tests/palm_sample/palm_definitions.py +70 -0
  50. palm_django-0.8.0/tests/settings.py +29 -0
  51. palm_django-0.8.0/tests/test_admin.py +39 -0
  52. palm_django-0.8.0/tests/test_commands.py +107 -0
  53. palm_django-0.8.0/tests/test_management.py +23 -0
  54. palm_django-0.8.0/tests/test_resources.py +112 -0
  55. palm_django-0.8.0/tests/test_runtime.py +21 -0
  56. palm_django-0.8.0/tests/test_schemas.py +141 -0
  57. palm_django-0.8.0/tests/test_server_command.py +94 -0
  58. palm_django-0.8.0/tests/test_settings.py +33 -0
  59. palm_django-0.8.0/tests/test_signals.py +68 -0
  60. palm_django-0.8.0/tests/test_storage.py +85 -0
  61. palm_django-0.8.0/tests/test_transactions.py +96 -0
  62. palm_django-0.8.0/tests/test_wizard_sample.py +49 -0
@@ -0,0 +1,234 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py.cover
50
+ *.lcov
51
+ .hypothesis/
52
+ .pytest_cache/
53
+ cover/
54
+
55
+ # Translations
56
+ *.mo
57
+ *.pot
58
+
59
+ # Django stuff:
60
+ *.log
61
+ local_settings.py
62
+ db.sqlite3
63
+ db.sqlite3-journal
64
+
65
+ # Flask stuff:
66
+ instance/
67
+ .webassets-cache
68
+
69
+ # Scrapy stuff:
70
+ .scrapy
71
+
72
+ # Sphinx documentation
73
+ docs/_build/
74
+
75
+ # PyBuilder
76
+ .pybuilder/
77
+ target/
78
+
79
+ # Jupyter Notebook
80
+ .ipynb_checkpoints
81
+
82
+ # IPython
83
+ profile_default/
84
+ ipython_config.py
85
+
86
+ # pyenv
87
+ # For a library or package, you might want to ignore these files since the code is
88
+ # intended to run in multiple environments; otherwise, check them in:
89
+ # .python-version
90
+
91
+ # pipenv
92
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
93
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
94
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
95
+ # install all needed dependencies.
96
+ # Pipfile.lock
97
+
98
+ # UV
99
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
100
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
101
+ # commonly ignored for libraries.
102
+ # uv.lock
103
+
104
+ # poetry
105
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
106
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
107
+ # commonly ignored for libraries.
108
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
109
+ # poetry.lock
110
+ # poetry.toml
111
+
112
+ # pdm
113
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
114
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
115
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
116
+ # pdm.lock
117
+ # pdm.toml
118
+ .pdm-python
119
+ .pdm-build/
120
+
121
+ # pixi
122
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
123
+ # pixi.lock
124
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
125
+ # in the .venv directory. It is recommended not to include this directory in version control.
126
+ .pixi/*
127
+ !.pixi/config.toml
128
+
129
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
130
+ __pypackages__/
131
+
132
+ # Celery stuff
133
+ celerybeat-schedule*
134
+ celerybeat.pid
135
+
136
+ # Redis
137
+ *.rdb
138
+ *.aof
139
+ *.pid
140
+
141
+ # RabbitMQ
142
+ mnesia/
143
+ rabbitmq/
144
+ rabbitmq-data/
145
+
146
+ # ActiveMQ
147
+ activemq-data/
148
+
149
+ # SageMath parsed files
150
+ *.sage.py
151
+
152
+ # Environments
153
+ .env
154
+ .envrc
155
+ .venv
156
+ env/
157
+ venv/
158
+ ENV/
159
+ env.bak/
160
+ venv.bak/
161
+
162
+ # Spyder project settings
163
+ .spyderproject
164
+ .spyproject
165
+
166
+ # Rope project settings
167
+ .ropeproject
168
+
169
+ # mkdocs documentation
170
+ /site
171
+
172
+ # mypy
173
+ .mypy_cache/
174
+ .dmypy.json
175
+ dmypy.json
176
+
177
+ # Pyre type checker
178
+ .pyre/
179
+
180
+ # pytype static type analyzer
181
+ .pytype/
182
+
183
+ # Cython debug symbols
184
+ cython_debug/
185
+
186
+ # PyCharm
187
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
188
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
189
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
190
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
191
+ # .idea/
192
+
193
+ # Abstra
194
+ # Abstra is an AI-powered process automation framework.
195
+ # Ignore directories containing user credentials, local state, and settings.
196
+ # Learn more at https://abstra.io/docs
197
+ .abstra/
198
+
199
+ # Visual Studio Code
200
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
201
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
202
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
203
+ # you could uncomment the following to ignore the entire vscode folder
204
+ # .vscode/
205
+ # Temporary file for partial code execution
206
+ tempCodeRunnerFile.py
207
+
208
+ # Ruff stuff:
209
+ .ruff_cache/
210
+
211
+ # PyPI configuration file
212
+ .pypirc
213
+
214
+ # Marimo
215
+ marimo/_static/
216
+ marimo/_lsp/
217
+ __marimo__/
218
+
219
+ # Streamlit
220
+ .streamlit/secrets.toml
221
+
222
+ # Database
223
+ *.db
224
+
225
+ # Repomix
226
+ repomix-output.xml
227
+
228
+ # Archive
229
+ archive/
230
+
231
+ # Data (keep directory placeholder in version control)
232
+ data/*
233
+ !data/
234
+ !data/.gitkeep
@@ -0,0 +1,41 @@
1
+ # Changelog
2
+
3
+ All notable changes to palm-django are documented here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
4
+
5
+ ## [Unreleased]
6
+
7
+ _No changes yet._
8
+
9
+ ## [0.8.0] — 2026-06-17
10
+
11
+ **First PyPI release** — production-ready Django integration for [Palm Engine](https://palmengine.org) 0.12.x.
12
+
13
+ Requires **Python 3.11+**, **Django 4.2+**, and **palmengine 0.12.9+**.
14
+
15
+ ### Added
16
+
17
+ - **Django app bootstrap** — `palm_django` in `INSTALLED_APPS` starts a process-wide `ApplicationHost` on `AppConfig.ready()`
18
+ - **`PALM` / `PALM_*` settings bridge** — Django settings map to `PalmSettings`; Django ORM is the default `storage_backend`
19
+ - **Auto-discovery** — scans each installed app for `palm_definitions` or `palm` modules (`register_definitions`, `register_resources`, `register_commit_handlers`)
20
+ - **Django ORM storage** — `PalmDefinition`, `PalmProcessInstance`, `PalmStorageEntry` models with initial migration
21
+ - **`DjangoStorageBackend`** — Palm `BaseBackend` backed by Django models
22
+ - **Django model resources** — `@as_palm_resource` decorator and `PalmResourceModel` base; auto-registers CRUD at `{app_label}.{model}.{action}`
23
+ - **`DjangoModelProvider`** — Palm provider (`django_model`) with transactional ORM mutations
24
+ - **Auto-generated schemas** — `schema=True` builds `DictStateSchema` from Django fields; registers `StateSchemaDefinition` refs; validates create/update payloads
25
+ - **Transaction bridging** — `palm_atomic()` and `django_atomic()` join Django `transaction.atomic()` without redundant savepoints
26
+ - **Signals** — `palm_resource_invoked`, `palm_model_saved`
27
+ - **Django Admin** — browse definitions, instances, storage entries; admin actions to start flows and resume instances
28
+ - **Management commands** — unified `python manage.py palm`:
29
+ - `doctor` (human + `--json`)
30
+ - `quickstart` (scaffold snippets)
31
+ - `server` / `host server` — `ServerRuntime` + Palm Explorer SSR hub
32
+ - `run`, `flow`, `instance`, `resource` subcommands (list, start, resume, invoke)
33
+ - **Public API** — `get_host()`, `get_app()`, `get_runtime()`, `bootstrap_palm()`, `shutdown_palm()`, settings helpers
34
+
35
+ ### Notes
36
+
37
+ - Wizard resource steps require `step_kind: resource`, `resource_ref`, and explicit `action` (e.g. `create`); omitting `action` defaults to `fetch`
38
+ - Palm Explorer `/explorer/schemas` lists **flow** state schemas only; Django model schemas appear under `/explorer/resources`
39
+ - Link flow steps to model schemas with `state_schema_ref: "myapp.order.data"`
40
+
41
+ [0.8.0]: https://github.com/JGabrielGruber/palm-django/releases/tag/v0.8.0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 José Gabriel Gruber
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.