django-dynamic-admin-forms 2.1.1__tar.gz → 2.2.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.
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/.ambient-package-update/metadata.py +3 -2
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/.github/workflows/ci.yml +6 -3
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/.gitignore +72 -72
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/.pre-commit-config.yaml +1 -1
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/.python-version +1 -1
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/CHANGES.md +73 -63
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/PKG-INFO +19 -16
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/README.md +8 -8
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/django_dynamic_admin_forms/__init__.py +1 -1
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/django_dynamic_admin_forms/apps.py +5 -5
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/django_dynamic_admin_forms/static/js/dynamic_admin.js +72 -72
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/django_dynamic_admin_forms/templates/admin/change_form.html +37 -37
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/django_dynamic_admin_forms/urls.py +8 -7
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/docs/index.rst +6 -6
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/e2e/cypress/integration/dynamic-select.spec.js +46 -46
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/e2e/cypress/plugins/index.js +22 -22
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/e2e/cypress/support/commands.js +25 -25
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/e2e/cypress/support/index.js +20 -20
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/e2e/cypress/support/paths.js +5 -5
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/e2e/cypress.json +6 -6
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/e2e/package.json +12 -12
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/e2e/yarn.lock +1152 -1152
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/fixtures/fixtures-dev.json +453 -453
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/manage.py +22 -22
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/pyproject.toml +13 -7
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/settings.py +86 -88
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/testapp/admin.py +72 -72
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/testapp/apps.py +6 -6
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/testapp/migrations/0001_initial.py +94 -94
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/testapp/migrations/0002_extend_example.py +24 -24
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/testapp/migrations/0003_example_file_field.py +23 -23
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/testapp/models.py +39 -39
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/testapp/urls.py +22 -22
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/tests/test_admin_unit.py +84 -84
- django_dynamic_admin_forms-2.1.1/requirements.txt +0 -172
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/.coveragerc +0 -0
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/.editorconfig +0 -0
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/.readthedocs.yaml +0 -0
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/LICENSE.md +0 -0
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/MANIFEST.in +0 -0
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/django_dynamic_admin_forms/admin.py +0 -0
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/docs/Makefile +0 -0
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/docs/conf.py +0 -0
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/docs/demo.gif +0 -0
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/docs/features/changelog.rst +0 -0
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/docs/make.bat +0 -0
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/pytest.init +0 -0
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/scripts/unix/install_requirements.sh +0 -0
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/scripts/unix/publish_to_pypi.sh +0 -0
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/scripts/windows/install_requirements.ps1 +0 -0
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/scripts/windows/publish_to_pypi.ps1 +0 -0
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/setup.cfg +0 -0
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/testapp/__init__.py +0 -0
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/testapp/migrations/__init__.py +0 -0
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/tests/__init__.py +0 -0
- {django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/tests/test_admin_generic.py +0 -0
|
@@ -9,6 +9,7 @@ from ambient_package_update.metadata.readme import ReadmeContent
|
|
|
9
9
|
|
|
10
10
|
METADATA = PackageMetadata(
|
|
11
11
|
package_name="django_dynamic_admin_forms",
|
|
12
|
+
github_package_name="django_dynamic_admin",
|
|
12
13
|
company="Ambient Innovation: GmbH",
|
|
13
14
|
authors=[
|
|
14
15
|
PackageAuthor(
|
|
@@ -188,11 +189,11 @@ $ yarn cypress # or npm run cypress
|
|
|
188
189
|
- Run `python manage.py collectstatic` to include this apps Javascript code in your `settings.STATIC_ROOT` directory
|
|
189
190
|
""",
|
|
190
191
|
),
|
|
192
|
+
supported_django_versions=SUPPORTED_DJANGO_VERSIONS,
|
|
193
|
+
supported_python_versions=SUPPORTED_PYTHON_VERSIONS,
|
|
191
194
|
dependencies=[
|
|
192
195
|
"django >=3.2",
|
|
193
196
|
],
|
|
194
|
-
supported_django_versions=SUPPORTED_DJANGO_VERSIONS,
|
|
195
|
-
supported_python_versions=SUPPORTED_PYTHON_VERSIONS,
|
|
196
197
|
optional_dependencies={
|
|
197
198
|
"dev": [
|
|
198
199
|
*DEV_DEPENDENCIES,
|
{django_dynamic_admin_forms-2.1.1 → django_dynamic_admin_forms-2.2.1}/.github/workflows/ci.yml
RENAMED
|
@@ -20,7 +20,6 @@ jobs:
|
|
|
20
20
|
|
|
21
21
|
- name: Run pre-commit hooks
|
|
22
22
|
run: pre-commit run --all-files --hook-stage push
|
|
23
|
-
|
|
24
23
|
|
|
25
24
|
|
|
26
25
|
tests:
|
|
@@ -29,7 +28,7 @@ jobs:
|
|
|
29
28
|
strategy:
|
|
30
29
|
matrix:
|
|
31
30
|
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', ]
|
|
32
|
-
django-version: ['32', '41', '42', ]
|
|
31
|
+
django-version: ['32', '41', '42', '50', ]
|
|
33
32
|
|
|
34
33
|
exclude:
|
|
35
34
|
- python-version: '3.12'
|
|
@@ -38,6 +37,10 @@ jobs:
|
|
|
38
37
|
django-version: 32
|
|
39
38
|
- python-version: '3.10'
|
|
40
39
|
django-version: 32
|
|
40
|
+
- python-version: '3.8'
|
|
41
|
+
django-version: 50
|
|
42
|
+
- python-version: '3.9'
|
|
43
|
+
django-version: 50
|
|
41
44
|
|
|
42
45
|
steps:
|
|
43
46
|
- uses: actions/checkout@v4
|
|
@@ -79,4 +82,4 @@ jobs:
|
|
|
79
82
|
- name: Combine coverage and fail if it's <100%
|
|
80
83
|
run: |
|
|
81
84
|
python -m coverage html --skip-covered --skip-empty
|
|
82
|
-
python -m coverage report --fail-under=100
|
|
85
|
+
python -m coverage report --fail-under=100.0
|
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
|
2
|
-
|
|
3
|
-
# dependencies
|
|
4
|
-
/node_modules
|
|
5
|
-
/.pnp
|
|
6
|
-
.pnp.js
|
|
7
|
-
|
|
8
|
-
# Visual Studio Code
|
|
9
|
-
.vscode/
|
|
10
|
-
|
|
11
|
-
# JetBrains
|
|
12
|
-
.idea/
|
|
13
|
-
|
|
14
|
-
# SublimeText
|
|
15
|
-
*.tmlanguage.cache
|
|
16
|
-
*.tmPreferences.cache
|
|
17
|
-
*.stTheme.cache
|
|
18
|
-
*.sublime-workspace
|
|
19
|
-
|
|
20
|
-
# OSX
|
|
21
|
-
.DS_Store
|
|
22
|
-
.AppleDouble
|
|
23
|
-
.LSOverride
|
|
24
|
-
|
|
25
|
-
# Basics
|
|
26
|
-
__pycache__
|
|
27
|
-
*.pid
|
|
28
|
-
*.db
|
|
29
|
-
.env
|
|
30
|
-
.venv
|
|
31
|
-
|
|
32
|
-
# NPM / Yarn
|
|
33
|
-
node_modules/
|
|
34
|
-
npm-debug.log*
|
|
35
|
-
yarn-debug.log*
|
|
36
|
-
yarn-error.log*
|
|
37
|
-
package-lock.json
|
|
38
|
-
|
|
39
|
-
# Celery
|
|
40
|
-
celerybeat-schedule
|
|
41
|
-
backend/celerybeat.pid
|
|
42
|
-
|
|
43
|
-
# Logs
|
|
44
|
-
*.log
|
|
45
|
-
pip-log.txt
|
|
46
|
-
|
|
47
|
-
# Unit test / coverage reports
|
|
48
|
-
.coverage
|
|
49
|
-
.tox
|
|
50
|
-
builds
|
|
51
|
-
htmlcov
|
|
52
|
-
test-reports
|
|
53
|
-
|
|
54
|
-
# Translations
|
|
55
|
-
*.mo
|
|
56
|
-
*.pot
|
|
57
|
-
|
|
58
|
-
# Media dir and collected statics
|
|
59
|
-
backend/media/*
|
|
60
|
-
!backend/media/test-data/*
|
|
61
|
-
*/staticfiles
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
# Cypress output
|
|
65
|
-
*/cypress/*
|
|
66
|
-
|
|
67
|
-
# Build output
|
|
68
|
-
dist
|
|
69
|
-
_build
|
|
70
|
-
|
|
71
|
-
# SCSS
|
|
72
|
-
.sass-cache/
|
|
1
|
+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
|
2
|
+
|
|
3
|
+
# dependencies
|
|
4
|
+
/node_modules
|
|
5
|
+
/.pnp
|
|
6
|
+
.pnp.js
|
|
7
|
+
|
|
8
|
+
# Visual Studio Code
|
|
9
|
+
.vscode/
|
|
10
|
+
|
|
11
|
+
# JetBrains
|
|
12
|
+
.idea/
|
|
13
|
+
|
|
14
|
+
# SublimeText
|
|
15
|
+
*.tmlanguage.cache
|
|
16
|
+
*.tmPreferences.cache
|
|
17
|
+
*.stTheme.cache
|
|
18
|
+
*.sublime-workspace
|
|
19
|
+
|
|
20
|
+
# OSX
|
|
21
|
+
.DS_Store
|
|
22
|
+
.AppleDouble
|
|
23
|
+
.LSOverride
|
|
24
|
+
|
|
25
|
+
# Basics
|
|
26
|
+
__pycache__
|
|
27
|
+
*.pid
|
|
28
|
+
*.db
|
|
29
|
+
.env
|
|
30
|
+
.venv
|
|
31
|
+
|
|
32
|
+
# NPM / Yarn
|
|
33
|
+
node_modules/
|
|
34
|
+
npm-debug.log*
|
|
35
|
+
yarn-debug.log*
|
|
36
|
+
yarn-error.log*
|
|
37
|
+
package-lock.json
|
|
38
|
+
|
|
39
|
+
# Celery
|
|
40
|
+
celerybeat-schedule
|
|
41
|
+
backend/celerybeat.pid
|
|
42
|
+
|
|
43
|
+
# Logs
|
|
44
|
+
*.log
|
|
45
|
+
pip-log.txt
|
|
46
|
+
|
|
47
|
+
# Unit test / coverage reports
|
|
48
|
+
.coverage
|
|
49
|
+
.tox
|
|
50
|
+
builds
|
|
51
|
+
htmlcov
|
|
52
|
+
test-reports
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Media dir and collected statics
|
|
59
|
+
backend/media/*
|
|
60
|
+
!backend/media/test-data/*
|
|
61
|
+
*/staticfiles
|
|
62
|
+
db.sqlite3
|
|
63
|
+
|
|
64
|
+
# Cypress output
|
|
65
|
+
*/cypress/*
|
|
66
|
+
|
|
67
|
+
# Build output
|
|
68
|
+
dist
|
|
69
|
+
_build
|
|
70
|
+
|
|
71
|
+
# SCSS
|
|
72
|
+
.sass-cache/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
3.11
|
|
1
|
+
3.11
|
|
@@ -1,63 +1,73 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
**2.
|
|
4
|
-
|
|
5
|
-
-
|
|
6
|
-
-
|
|
7
|
-
|
|
8
|
-
**2.
|
|
9
|
-
|
|
10
|
-
- Added
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
**2.2.1**
|
|
4
|
+
|
|
5
|
+
- Fixed security issue with URL not being wrapped in `admin_view`
|
|
6
|
+
- Improved documentation
|
|
7
|
+
|
|
8
|
+
**2.2.0**
|
|
9
|
+
|
|
10
|
+
- Added Django 5.0 support
|
|
11
|
+
- Multiple maintenance improvements
|
|
12
|
+
|
|
13
|
+
**2.1.1**
|
|
14
|
+
|
|
15
|
+
- 100% coverage and bugfix in edge case
|
|
16
|
+
- Updates via ambient package updater
|
|
17
|
+
|
|
18
|
+
**2.1.0**
|
|
19
|
+
|
|
20
|
+
- Added Python 3.12 support
|
|
21
|
+
|
|
22
|
+
**2.0.1**
|
|
23
|
+
|
|
24
|
+
- Meta updates via ambient-package-update
|
|
25
|
+
|
|
26
|
+
**2.0.0**
|
|
27
|
+
|
|
28
|
+
- Dropped support for deprecated Django versions 2.2, 3.0, 3.1 & 4.0
|
|
29
|
+
- Updated linters and added more strict linting rules
|
|
30
|
+
|
|
31
|
+
**1.0.1**
|
|
32
|
+
|
|
33
|
+
- Tiy code cleanup
|
|
34
|
+
|
|
35
|
+
**1.0.0**
|
|
36
|
+
|
|
37
|
+
- Reduce amount of requests, move to ambient-package-update
|
|
38
|
+
|
|
39
|
+
**0.1.8**
|
|
40
|
+
|
|
41
|
+
- Improve support for select2 widgets used by Jazzmin
|
|
42
|
+
|
|
43
|
+
**0.1.7**
|
|
44
|
+
|
|
45
|
+
- Improve Jazzmin support and forms with file fields
|
|
46
|
+
|
|
47
|
+
**0.1.6**
|
|
48
|
+
|
|
49
|
+
- Support dynamic fields for custom form fields
|
|
50
|
+
|
|
51
|
+
**0.1.5**
|
|
52
|
+
|
|
53
|
+
- Jazzmin "support"
|
|
54
|
+
|
|
55
|
+
**0.1.4**
|
|
56
|
+
|
|
57
|
+
- README fixes
|
|
58
|
+
|
|
59
|
+
**0.1.3**
|
|
60
|
+
|
|
61
|
+
- Change Demo-GIF hosting
|
|
62
|
+
|
|
63
|
+
**0.1.2**
|
|
64
|
+
|
|
65
|
+
- README fixes
|
|
66
|
+
|
|
67
|
+
**0.1.1**
|
|
68
|
+
|
|
69
|
+
- README fixes
|
|
70
|
+
|
|
71
|
+
**0.1.0**
|
|
72
|
+
|
|
73
|
+
- Initial release
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: django-dynamic-admin-forms
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.2.1
|
|
4
4
|
Summary: Add simple dynamic interaction to the otherwise static django admin.
|
|
5
5
|
Author-email: Ambient Digital <hello@ambient.digital>, Fabian Binz <fabian.binz@ambient.digital>
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
@@ -10,6 +10,7 @@ Classifier: Framework :: Django
|
|
|
10
10
|
Classifier: Framework :: Django :: 3.2
|
|
11
11
|
Classifier: Framework :: Django :: 4.1
|
|
12
12
|
Classifier: Framework :: Django :: 4.2
|
|
13
|
+
Classifier: Framework :: Django :: 5.0
|
|
13
14
|
Classifier: Intended Audience :: Developers
|
|
14
15
|
Classifier: License :: OSI Approved :: MIT License
|
|
15
16
|
Classifier: Natural Language :: English
|
|
@@ -23,28 +24,30 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
23
24
|
Classifier: Programming Language :: Python :: 3.12
|
|
24
25
|
Classifier: Topic :: Utilities
|
|
25
26
|
Requires-Dist: django >=3.2
|
|
26
|
-
Requires-Dist:
|
|
27
|
-
Requires-Dist:
|
|
28
|
-
Requires-Dist: pytest-
|
|
27
|
+
Requires-Dist: typer~=0.9 ; extra == "dev"
|
|
28
|
+
Requires-Dist: freezegun~=1.3 ; extra == "dev"
|
|
29
|
+
Requires-Dist: pytest-django~=4.7 ; extra == "dev"
|
|
30
|
+
Requires-Dist: pytest-mock~=3.12 ; extra == "dev"
|
|
29
31
|
Requires-Dist: coverage~=7.3 ; extra == "dev"
|
|
30
32
|
Requires-Dist: pre-commit~=3.5 ; extra == "dev"
|
|
31
|
-
Requires-Dist: ruff~=0.1 ; extra == "dev"
|
|
33
|
+
Requires-Dist: ruff~=0.1.7 ; extra == "dev"
|
|
32
34
|
Requires-Dist: sphinx==4.2.0 ; extra == "dev"
|
|
33
35
|
Requires-Dist: sphinx-rtd-theme==1.0.0 ; extra == "dev"
|
|
34
36
|
Requires-Dist: m2r2==0.3.1 ; extra == "dev"
|
|
35
37
|
Requires-Dist: mistune<2.0.0 ; extra == "dev"
|
|
36
|
-
Requires-Dist:
|
|
38
|
+
Requires-Dist: flit~=3.9 ; extra == "dev"
|
|
39
|
+
Requires-Dist: ambient-package-update~=23.12.4 ; extra == "dev"
|
|
37
40
|
Requires-Dist: unittest-parametrize~=1.4 ; extra == "dev"
|
|
38
|
-
Project-URL: Bugtracker, https://github.com/ambient-innovation/django-dynamic-admin
|
|
41
|
+
Project-URL: Bugtracker, https://github.com/ambient-innovation/django-dynamic-admin/issues
|
|
39
42
|
Project-URL: Changelog, https://django-dynamic-admin-forms.readthedocs.io/en/latest/features/changelog.html
|
|
40
43
|
Project-URL: Documentation, https://django-dynamic-admin-forms.readthedocs.io/en/latest/index.html
|
|
41
|
-
Project-URL: Homepage, https://github.com/ambient-innovation/django-dynamic-admin
|
|
44
|
+
Project-URL: Homepage, https://github.com/ambient-innovation/django-dynamic-admin/
|
|
42
45
|
Project-URL: Maintained by, https://ambient.digital/
|
|
43
46
|
Provides-Extra: dev
|
|
44
47
|
|
|
45
48
|
[](https://pypi.org/project/django-dynamic-admin-forms/)
|
|
46
49
|
[](https://pepy.tech/project/django-dynamic-admin-forms)
|
|
47
|
-
[](https://github.com/ambient-innovation/django-dynamic-admin
|
|
50
|
+
[](https://github.com/ambient-innovation/django-dynamic-admin/actions?workflow=CI)
|
|
48
51
|
[](https://github.com/astral-sh/ruff)
|
|
49
52
|
[](https://github.com/astral-sh/ruff)
|
|
50
53
|
[](https://django-dynamic-admin-forms.readthedocs.io/en/latest/?badge=latest)
|
|
@@ -52,7 +55,7 @@ Provides-Extra: dev
|
|
|
52
55
|
Add simple interactions to the otherwise static django admin.
|
|
53
56
|
|
|
54
57
|
* [PyPI](https://pypi.org/project/django-dynamic-admin-forms/)
|
|
55
|
-
* [GitHub](https://github.com/ambient-innovation/django-dynamic-admin
|
|
58
|
+
* [GitHub](https://github.com/ambient-innovation/django-dynamic-admin)
|
|
56
59
|
* [Full documentation](https://django-dynamic-admin-forms.readthedocs.io/en/latest/index.html)
|
|
57
60
|
* Creator & Maintainer: [Ambient Digital](https://ambient.digital)
|
|
58
61
|
|
|
@@ -160,16 +163,16 @@ outerHTML of the correct HTML elements to update the form.
|
|
|
160
163
|
For local development, create a virtual environment
|
|
161
164
|
in the `testproj` folder:
|
|
162
165
|
```shell
|
|
163
|
-
$ cd
|
|
166
|
+
$ cd testapp
|
|
164
167
|
$ python3 -m venv .venv
|
|
165
168
|
$ source .venv/bin/activate
|
|
166
169
|
$ cd ..
|
|
167
|
-
$
|
|
170
|
+
$ pip install -e .
|
|
168
171
|
```
|
|
169
172
|
Now the package should be available in your virtual environment
|
|
170
|
-
and any changes should be directly visible.
|
|
173
|
+
and any changes should be directly visible. Run the project as a Django server and navigate to the admin page.
|
|
171
174
|
|
|
172
|
-
Alternatively,
|
|
175
|
+
Alternatively, copy the directory `dynamic_admin_forms`
|
|
173
176
|
into any normal django project, so that the python interpreter
|
|
174
177
|
finds the local version instead of the installed (old) version.
|
|
175
178
|
|
|
@@ -177,7 +180,7 @@ finds the local version instead of the installed (old) version.
|
|
|
177
180
|
|
|
178
181
|
To run end-to-end tests locally:
|
|
179
182
|
```shell
|
|
180
|
-
$ cd
|
|
183
|
+
$ cd testapp
|
|
181
184
|
$ python manage.py runserver 0.0.0.0:8000 & # start server
|
|
182
185
|
$ python manage.py loaddata fixtures/fixtures-dev.json
|
|
183
186
|
$ cd ../e2e
|
|
@@ -229,7 +232,7 @@ $ yarn cypress # or npm run cypress
|
|
|
229
232
|
### Setup package for development
|
|
230
233
|
|
|
231
234
|
- Create a Python virtualenv and activate it
|
|
232
|
-
- Install "pip-tools" with `pip install pip-tools`
|
|
235
|
+
- Install "pip-tools" with `pip install -U pip-tools`
|
|
233
236
|
- Compile the requirements with `pip-compile --extra dev, -o requirements.txt pyproject.toml --resolver=backtracking`
|
|
234
237
|
- Sync the dependencies with your virtualenv with `pip-sync`
|
|
235
238
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[](https://pypi.org/project/django-dynamic-admin-forms/)
|
|
2
2
|
[](https://pepy.tech/project/django-dynamic-admin-forms)
|
|
3
|
-
[](https://github.com/ambient-innovation/django-dynamic-admin
|
|
3
|
+
[](https://github.com/ambient-innovation/django-dynamic-admin/actions?workflow=CI)
|
|
4
4
|
[](https://github.com/astral-sh/ruff)
|
|
5
5
|
[](https://github.com/astral-sh/ruff)
|
|
6
6
|
[](https://django-dynamic-admin-forms.readthedocs.io/en/latest/?badge=latest)
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
Add simple interactions to the otherwise static django admin.
|
|
9
9
|
|
|
10
10
|
* [PyPI](https://pypi.org/project/django-dynamic-admin-forms/)
|
|
11
|
-
* [GitHub](https://github.com/ambient-innovation/django-dynamic-admin
|
|
11
|
+
* [GitHub](https://github.com/ambient-innovation/django-dynamic-admin)
|
|
12
12
|
* [Full documentation](https://django-dynamic-admin-forms.readthedocs.io/en/latest/index.html)
|
|
13
13
|
* Creator & Maintainer: [Ambient Digital](https://ambient.digital)
|
|
14
14
|
|
|
@@ -116,16 +116,16 @@ outerHTML of the correct HTML elements to update the form.
|
|
|
116
116
|
For local development, create a virtual environment
|
|
117
117
|
in the `testproj` folder:
|
|
118
118
|
```shell
|
|
119
|
-
$ cd
|
|
119
|
+
$ cd testapp
|
|
120
120
|
$ python3 -m venv .venv
|
|
121
121
|
$ source .venv/bin/activate
|
|
122
122
|
$ cd ..
|
|
123
|
-
$
|
|
123
|
+
$ pip install -e .
|
|
124
124
|
```
|
|
125
125
|
Now the package should be available in your virtual environment
|
|
126
|
-
and any changes should be directly visible.
|
|
126
|
+
and any changes should be directly visible. Run the project as a Django server and navigate to the admin page.
|
|
127
127
|
|
|
128
|
-
Alternatively,
|
|
128
|
+
Alternatively, copy the directory `dynamic_admin_forms`
|
|
129
129
|
into any normal django project, so that the python interpreter
|
|
130
130
|
finds the local version instead of the installed (old) version.
|
|
131
131
|
|
|
@@ -133,7 +133,7 @@ finds the local version instead of the installed (old) version.
|
|
|
133
133
|
|
|
134
134
|
To run end-to-end tests locally:
|
|
135
135
|
```shell
|
|
136
|
-
$ cd
|
|
136
|
+
$ cd testapp
|
|
137
137
|
$ python manage.py runserver 0.0.0.0:8000 & # start server
|
|
138
138
|
$ python manage.py loaddata fixtures/fixtures-dev.json
|
|
139
139
|
$ cd ../e2e
|
|
@@ -185,7 +185,7 @@ $ yarn cypress # or npm run cypress
|
|
|
185
185
|
### Setup package for development
|
|
186
186
|
|
|
187
187
|
- Create a Python virtualenv and activate it
|
|
188
|
-
- Install "pip-tools" with `pip install pip-tools`
|
|
188
|
+
- Install "pip-tools" with `pip install -U pip-tools`
|
|
189
189
|
- Compile the requirements with `pip-compile --extra dev, -o requirements.txt pyproject.toml --resolver=backtracking`
|
|
190
190
|
- Sync the dependencies with your virtualenv with `pip-sync`
|
|
191
191
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
from django.apps import AppConfig
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class DynamicSelectConfig(AppConfig):
|
|
5
|
-
name = "django_dynamic_admin_forms"
|
|
1
|
+
from django.apps import AppConfig
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class DynamicSelectConfig(AppConfig):
|
|
5
|
+
name = "django_dynamic_admin_forms"
|
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
var DynamicAdmin = {
|
|
2
|
-
//# sourceURL="dynamic_admin.js"
|
|
3
|
-
handleResponse: function (target, data) {
|
|
4
|
-
var $ = django.jQuery;
|
|
5
|
-
|
|
6
|
-
// set hidden class in parent form-row (or form-group if using jazzmin)
|
|
7
|
-
if (data.hidden) {
|
|
8
|
-
$(target.closest(".form-row,.form-group")).addClass("hidden");
|
|
9
|
-
} else {
|
|
10
|
-
$(target.closest(".form-row,.form-group")).removeClass("hidden");
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
// file fields will have this skipUpdate flag set
|
|
14
|
-
// TODO It might be easier to just look at the type attribute of the input element...
|
|
15
|
-
if (data.skipUpdate) {
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// Update the options for the select widget (either select2 instance or normal select element)
|
|
20
|
-
if ($(target).find("select").hasClass("select2-hidden-accessible")) {
|
|
21
|
-
var select2Widget = $(target).find("select");
|
|
22
|
-
var currentVal = select2Widget.val();
|
|
23
|
-
var options = $($.parseHTML(data.html)).find("option");
|
|
24
|
-
select2Widget.find("option").remove();
|
|
25
|
-
select2Widget.append(options);
|
|
26
|
-
select2Widget.val(currentVal);
|
|
27
|
-
} else {
|
|
28
|
-
target.outerHTML = data.html;
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
dynamicWidgets: function (
|
|
33
|
-
app_label,
|
|
34
|
-
model_name,
|
|
35
|
-
select_field_names,
|
|
36
|
-
input_field_names
|
|
37
|
-
) {
|
|
38
|
-
var $ = django.jQuery;
|
|
39
|
-
var that = this;
|
|
40
|
-
|
|
41
|
-
var $form = $("#" + model_name + "_form");
|
|
42
|
-
|
|
43
|
-
$form.on("change", function () {
|
|
44
|
-
var field_names = [...select_field_names, ...input_field_names];
|
|
45
|
-
var params = new URLSearchParams([
|
|
46
|
-
["app_label", app_label],
|
|
47
|
-
["model_name", model_name],
|
|
48
|
-
...field_names.map((name) => ["field_names", name]),
|
|
49
|
-
]);
|
|
50
|
-
var url = `/dynamic-admin-form/?${params}`;
|
|
51
|
-
$.post({
|
|
52
|
-
url,
|
|
53
|
-
data: new FormData(this),
|
|
54
|
-
contentType: false,
|
|
55
|
-
processData: false,
|
|
56
|
-
success: function (data) {
|
|
57
|
-
snippets = JSON.parse(data);
|
|
58
|
-
snippets.forEach(({ field_name, ...data }) => {
|
|
59
|
-
if (select_field_names.indexOf(field_name) >= 0) {
|
|
60
|
-
var target = $(
|
|
61
|
-
".field-" + field_name + " .related-widget-wrapper"
|
|
62
|
-
)[0];
|
|
63
|
-
} else {
|
|
64
|
-
var target = $("#id_" + field_name)[0];
|
|
65
|
-
}
|
|
66
|
-
that.handleResponse(target, data);
|
|
67
|
-
});
|
|
68
|
-
},
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
},
|
|
72
|
-
};
|
|
1
|
+
var DynamicAdmin = {
|
|
2
|
+
//# sourceURL="dynamic_admin.js"
|
|
3
|
+
handleResponse: function (target, data) {
|
|
4
|
+
var $ = django.jQuery;
|
|
5
|
+
|
|
6
|
+
// set hidden class in parent form-row (or form-group if using jazzmin)
|
|
7
|
+
if (data.hidden) {
|
|
8
|
+
$(target.closest(".form-row,.form-group")).addClass("hidden");
|
|
9
|
+
} else {
|
|
10
|
+
$(target.closest(".form-row,.form-group")).removeClass("hidden");
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// file fields will have this skipUpdate flag set
|
|
14
|
+
// TODO It might be easier to just look at the type attribute of the input element...
|
|
15
|
+
if (data.skipUpdate) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Update the options for the select widget (either select2 instance or normal select element)
|
|
20
|
+
if ($(target).find("select").hasClass("select2-hidden-accessible")) {
|
|
21
|
+
var select2Widget = $(target).find("select");
|
|
22
|
+
var currentVal = select2Widget.val();
|
|
23
|
+
var options = $($.parseHTML(data.html)).find("option");
|
|
24
|
+
select2Widget.find("option").remove();
|
|
25
|
+
select2Widget.append(options);
|
|
26
|
+
select2Widget.val(currentVal);
|
|
27
|
+
} else {
|
|
28
|
+
target.outerHTML = data.html;
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
dynamicWidgets: function (
|
|
33
|
+
app_label,
|
|
34
|
+
model_name,
|
|
35
|
+
select_field_names,
|
|
36
|
+
input_field_names
|
|
37
|
+
) {
|
|
38
|
+
var $ = django.jQuery;
|
|
39
|
+
var that = this;
|
|
40
|
+
|
|
41
|
+
var $form = $("#" + model_name + "_form");
|
|
42
|
+
|
|
43
|
+
$form.on("change", function () {
|
|
44
|
+
var field_names = [...select_field_names, ...input_field_names];
|
|
45
|
+
var params = new URLSearchParams([
|
|
46
|
+
["app_label", app_label],
|
|
47
|
+
["model_name", model_name],
|
|
48
|
+
...field_names.map((name) => ["field_names", name]),
|
|
49
|
+
]);
|
|
50
|
+
var url = `/dynamic-admin-form/?${params}`;
|
|
51
|
+
$.post({
|
|
52
|
+
url,
|
|
53
|
+
data: new FormData(this),
|
|
54
|
+
contentType: false,
|
|
55
|
+
processData: false,
|
|
56
|
+
success: function (data) {
|
|
57
|
+
snippets = JSON.parse(data);
|
|
58
|
+
snippets.forEach(({ field_name, ...data }) => {
|
|
59
|
+
if (select_field_names.indexOf(field_name) >= 0) {
|
|
60
|
+
var target = $(
|
|
61
|
+
".field-" + field_name + " .related-widget-wrapper"
|
|
62
|
+
)[0];
|
|
63
|
+
} else {
|
|
64
|
+
var target = $("#id_" + field_name)[0];
|
|
65
|
+
}
|
|
66
|
+
that.handleResponse(target, data);
|
|
67
|
+
});
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
},
|
|
72
|
+
};
|