django-dynamic-admin-forms 3.0.3__tar.gz → 3.0.4__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-3.0.3 → django_dynamic_admin_forms-3.0.4}/.ambient-package-update/templates/snippets/content.tpl +1 -4
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/.ambient-package-update/templates/snippets/installation.tpl +1 -4
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/.pre-commit-config.yaml +8 -0
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/CHANGES.md +3 -0
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/PKG-INFO +26 -32
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/README.md +24 -30
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/django_dynamic_admin_forms/__init__.py +1 -1
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/pyproject.toml +1 -1
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/.ambient-package-update/metadata.py +0 -0
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/.coveragerc +0 -0
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/.editorconfig +0 -0
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/.github/workflows/ci.yml +0 -0
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/.gitignore +0 -0
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/.python-version +0 -0
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/.readthedocs.yaml +0 -0
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/LICENSE.md +0 -0
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/MANIFEST.in +0 -0
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/django_dynamic_admin_forms/admin.py +0 -0
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/django_dynamic_admin_forms/apps.py +0 -0
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/django_dynamic_admin_forms/static/js/dynamic_admin.js +0 -0
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/django_dynamic_admin_forms/templates/admin/change_form.html +0 -0
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/django_dynamic_admin_forms/urls.py +0 -0
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/docs/Makefile +0 -0
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/docs/conf.py +0 -0
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/docs/demo.gif +0 -0
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/docs/features/changelog.rst +0 -0
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/docs/index.rst +0 -0
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/docs/make.bat +0 -0
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/e2e/cypress/integration/dynamic-select.spec.js +0 -0
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/e2e/cypress/plugins/index.js +0 -0
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/e2e/cypress/support/commands.js +0 -0
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/e2e/cypress/support/index.js +0 -0
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/e2e/cypress/support/paths.js +0 -0
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/e2e/cypress.json +0 -0
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/e2e/package.json +0 -0
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/e2e/yarn.lock +0 -0
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/fixtures/fixtures-dev.json +0 -0
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/manage.py +0 -0
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/scripts/unix/install_requirements.sh +0 -0
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/scripts/unix/publish_to_pypi.sh +0 -0
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/scripts/windows/install_requirements.ps1 +0 -0
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/scripts/windows/publish_to_pypi.ps1 +0 -0
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/settings.py +0 -0
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/setup.cfg +0 -0
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/testapp/__init__.py +0 -0
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/testapp/admin.py +0 -0
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/testapp/apps.py +0 -0
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/testapp/migrations/0001_initial.py +0 -0
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/testapp/migrations/0002_extend_example.py +0 -0
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/testapp/migrations/0003_example_file_field.py +0 -0
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/testapp/migrations/__init__.py +0 -0
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/testapp/models.py +0 -0
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/testapp/urls.py +0 -0
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/tests/__init__.py +0 -0
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/tests/test_admin_generic.py +0 -0
- {django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/tests/test_admin_unit.py +0 -0
|
@@ -16,10 +16,8 @@ Add simple interactions to the otherwise static django admin.
|
|
|
16
16
|
- Add the module to `INSTALLED_APPS`:
|
|
17
17
|
```python
|
|
18
18
|
INSTALLED_APPS = (
|
|
19
|
-
...,
|
|
20
19
|
'django_dynamic_admin_forms',
|
|
21
|
-
'django.contrib.admin'
|
|
22
|
-
...
|
|
20
|
+
'django.contrib.admin',
|
|
23
21
|
)
|
|
24
22
|
```
|
|
25
23
|
Ensure that the `dynamic_admin_forms` comes before the
|
|
@@ -32,7 +30,6 @@ Add simple interactions to the otherwise static django admin.
|
|
|
32
30
|
{
|
|
33
31
|
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
|
34
32
|
'APP_DIRS': True,
|
|
35
|
-
...
|
|
36
33
|
},
|
|
37
34
|
]
|
|
38
35
|
```
|
|
@@ -11,10 +11,8 @@
|
|
|
11
11
|
- Add the module to `INSTALLED_APPS`:
|
|
12
12
|
```python
|
|
13
13
|
INSTALLED_APPS = (
|
|
14
|
-
...,
|
|
15
14
|
'django_dynamic_admin_forms',
|
|
16
|
-
'django.contrib.admin'
|
|
17
|
-
...
|
|
15
|
+
'django.contrib.admin',
|
|
18
16
|
)
|
|
19
17
|
```
|
|
20
18
|
Ensure that the `dynamic_admin_forms` comes before the
|
|
@@ -28,7 +26,6 @@
|
|
|
28
26
|
{
|
|
29
27
|
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
|
30
28
|
'APP_DIRS': True,
|
|
31
|
-
...
|
|
32
29
|
},
|
|
33
30
|
]
|
|
34
31
|
```
|
{django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/.pre-commit-config.yaml
RENAMED
|
@@ -11,6 +11,14 @@ repos:
|
|
|
11
11
|
# Run the Ruff formatter.
|
|
12
12
|
- id: ruff-format
|
|
13
13
|
|
|
14
|
+
- repo: https://github.com/adamchainz/blacken-docs
|
|
15
|
+
rev: 1.16.0
|
|
16
|
+
hooks:
|
|
17
|
+
- id: blacken-docs
|
|
18
|
+
additional_dependencies:
|
|
19
|
+
- black==24.4.2
|
|
20
|
+
files: '(?:README\.md|docs\/.*\.(?:md|rst))'
|
|
21
|
+
|
|
14
22
|
- repo: https://github.com/asottile/pyupgrade
|
|
15
23
|
rev: v3.16.0
|
|
16
24
|
hooks:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: django-dynamic-admin-forms
|
|
3
|
-
Version: 3.0.
|
|
3
|
+
Version: 3.0.4
|
|
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
|
|
@@ -34,7 +34,7 @@ Requires-Dist: sphinx-rtd-theme~=2.0 ; extra == "dev"
|
|
|
34
34
|
Requires-Dist: m2r2==0.3.3.post2 ; extra == "dev"
|
|
35
35
|
Requires-Dist: mistune<2.0.0 ; extra == "dev"
|
|
36
36
|
Requires-Dist: flit~=3.9 ; extra == "dev"
|
|
37
|
-
Requires-Dist: ambient-package-update~=24.6.
|
|
37
|
+
Requires-Dist: ambient-package-update~=24.6.4 ; extra == "dev"
|
|
38
38
|
Requires-Dist: unittest-parametrize~=1.4 ; extra == "dev"
|
|
39
39
|
Project-URL: Bugtracker, https://github.com/ambient-innovation/django-dynamic-admin/issues
|
|
40
40
|
Project-URL: Changelog, https://django-dynamic-admin-forms.readthedocs.io/en/latest/features/changelog.html
|
|
@@ -76,10 +76,8 @@ Add simple interactions to the otherwise static django admin.
|
|
|
76
76
|
- Add the module to `INSTALLED_APPS`:
|
|
77
77
|
```python
|
|
78
78
|
INSTALLED_APPS = (
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
'django.contrib.admin'
|
|
82
|
-
...
|
|
79
|
+
"django_dynamic_admin_forms",
|
|
80
|
+
"django.contrib.admin",
|
|
83
81
|
)
|
|
84
82
|
```
|
|
85
83
|
Ensure that the `dynamic_admin_forms` comes before the
|
|
@@ -90,9 +88,8 @@ Add simple interactions to the otherwise static django admin.
|
|
|
90
88
|
```python
|
|
91
89
|
TEMPLATES = [
|
|
92
90
|
{
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
...
|
|
91
|
+
"BACKEND": "django.template.backends.django.DjangoTemplates",
|
|
92
|
+
"APP_DIRS": True,
|
|
96
93
|
},
|
|
97
94
|
]
|
|
98
95
|
```
|
|
@@ -106,8 +103,8 @@ Add simple interactions to the otherwise static django admin.
|
|
|
106
103
|
from django.urls import path, include
|
|
107
104
|
|
|
108
105
|
urlpatterns = [
|
|
109
|
-
|
|
110
|
-
|
|
106
|
+
path("admin/", admin.site.urls),
|
|
107
|
+
path("dynamic-admin-form/", include("django_dynamic_admin_forms.urls")),
|
|
111
108
|
]
|
|
112
109
|
```
|
|
113
110
|
- In addition to the standard `fields` declaration, specify a list of `dynamic_fields`
|
|
@@ -128,20 +125,20 @@ Add simple interactions to the otherwise static django admin.
|
|
|
128
125
|
|
|
129
126
|
@admin.register(MyModel)
|
|
130
127
|
class MyModelAdmin(DynamicModelAdminMixin, admin.ModelAdmin):
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
128
|
+
fields = ("name", "city")
|
|
129
|
+
dynamic_fields = ("city",)
|
|
130
|
+
|
|
131
|
+
def get_dynamic_city_field(self, data):
|
|
132
|
+
# automatically choose first city that matches first letter of name
|
|
133
|
+
name = data.get("name")
|
|
134
|
+
if not name:
|
|
135
|
+
queryset = City.objects.all()
|
|
136
|
+
value = data.get("city")
|
|
137
|
+
else:
|
|
138
|
+
queryset = City.objects.filter(name__startswith=name[0])
|
|
139
|
+
value = queryset.first()
|
|
140
|
+
hidden = not queryset.exists()
|
|
141
|
+
return queryset, value, hidden
|
|
145
142
|
```
|
|
146
143
|
|
|
147
144
|
|
|
@@ -200,10 +197,8 @@ $ yarn cypress # or npm run cypress
|
|
|
200
197
|
- Add the module to `INSTALLED_APPS`:
|
|
201
198
|
```python
|
|
202
199
|
INSTALLED_APPS = (
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
'django.contrib.admin'
|
|
206
|
-
...
|
|
200
|
+
"django_dynamic_admin_forms",
|
|
201
|
+
"django.contrib.admin",
|
|
207
202
|
)
|
|
208
203
|
```
|
|
209
204
|
Ensure that the `dynamic_admin_forms` comes before the
|
|
@@ -215,9 +210,8 @@ $ yarn cypress # or npm run cypress
|
|
|
215
210
|
```python
|
|
216
211
|
TEMPLATES = [
|
|
217
212
|
{
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
...
|
|
213
|
+
"BACKEND": "django.template.backends.django.DjangoTemplates",
|
|
214
|
+
"APP_DIRS": True,
|
|
221
215
|
},
|
|
222
216
|
]
|
|
223
217
|
```
|
|
@@ -31,10 +31,8 @@ Add simple interactions to the otherwise static django admin.
|
|
|
31
31
|
- Add the module to `INSTALLED_APPS`:
|
|
32
32
|
```python
|
|
33
33
|
INSTALLED_APPS = (
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
'django.contrib.admin'
|
|
37
|
-
...
|
|
34
|
+
"django_dynamic_admin_forms",
|
|
35
|
+
"django.contrib.admin",
|
|
38
36
|
)
|
|
39
37
|
```
|
|
40
38
|
Ensure that the `dynamic_admin_forms` comes before the
|
|
@@ -45,9 +43,8 @@ Add simple interactions to the otherwise static django admin.
|
|
|
45
43
|
```python
|
|
46
44
|
TEMPLATES = [
|
|
47
45
|
{
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
...
|
|
46
|
+
"BACKEND": "django.template.backends.django.DjangoTemplates",
|
|
47
|
+
"APP_DIRS": True,
|
|
51
48
|
},
|
|
52
49
|
]
|
|
53
50
|
```
|
|
@@ -61,8 +58,8 @@ Add simple interactions to the otherwise static django admin.
|
|
|
61
58
|
from django.urls import path, include
|
|
62
59
|
|
|
63
60
|
urlpatterns = [
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
path("admin/", admin.site.urls),
|
|
62
|
+
path("dynamic-admin-form/", include("django_dynamic_admin_forms.urls")),
|
|
66
63
|
]
|
|
67
64
|
```
|
|
68
65
|
- In addition to the standard `fields` declaration, specify a list of `dynamic_fields`
|
|
@@ -83,20 +80,20 @@ Add simple interactions to the otherwise static django admin.
|
|
|
83
80
|
|
|
84
81
|
@admin.register(MyModel)
|
|
85
82
|
class MyModelAdmin(DynamicModelAdminMixin, admin.ModelAdmin):
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
83
|
+
fields = ("name", "city")
|
|
84
|
+
dynamic_fields = ("city",)
|
|
85
|
+
|
|
86
|
+
def get_dynamic_city_field(self, data):
|
|
87
|
+
# automatically choose first city that matches first letter of name
|
|
88
|
+
name = data.get("name")
|
|
89
|
+
if not name:
|
|
90
|
+
queryset = City.objects.all()
|
|
91
|
+
value = data.get("city")
|
|
92
|
+
else:
|
|
93
|
+
queryset = City.objects.filter(name__startswith=name[0])
|
|
94
|
+
value = queryset.first()
|
|
95
|
+
hidden = not queryset.exists()
|
|
96
|
+
return queryset, value, hidden
|
|
100
97
|
```
|
|
101
98
|
|
|
102
99
|
|
|
@@ -155,10 +152,8 @@ $ yarn cypress # or npm run cypress
|
|
|
155
152
|
- Add the module to `INSTALLED_APPS`:
|
|
156
153
|
```python
|
|
157
154
|
INSTALLED_APPS = (
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
'django.contrib.admin'
|
|
161
|
-
...
|
|
155
|
+
"django_dynamic_admin_forms",
|
|
156
|
+
"django.contrib.admin",
|
|
162
157
|
)
|
|
163
158
|
```
|
|
164
159
|
Ensure that the `dynamic_admin_forms` comes before the
|
|
@@ -170,9 +165,8 @@ $ yarn cypress # or npm run cypress
|
|
|
170
165
|
```python
|
|
171
166
|
TEMPLATES = [
|
|
172
167
|
{
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
...
|
|
168
|
+
"BACKEND": "django.template.backends.django.DjangoTemplates",
|
|
169
|
+
"APP_DIRS": True,
|
|
176
170
|
},
|
|
177
171
|
]
|
|
178
172
|
```
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/.github/workflows/ci.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/docs/features/changelog.rst
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/e2e/cypress/plugins/index.js
RENAMED
|
File without changes
|
|
File without changes
|
{django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/e2e/cypress/support/index.js
RENAMED
|
File without changes
|
{django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/e2e/cypress/support/paths.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/fixtures/fixtures-dev.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/testapp/migrations/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/tests/test_admin_generic.py
RENAMED
|
File without changes
|
{django_dynamic_admin_forms-3.0.3 → django_dynamic_admin_forms-3.0.4}/tests/test_admin_unit.py
RENAMED
|
File without changes
|