django-dynamic-admin-forms 3.0.2__tar.gz → 3.0.3__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/.ambient-package-update/metadata.py +45 -0
- django_dynamic_admin_forms-3.0.2/.ambient-package-update/metadata.py → django_dynamic_admin_forms-3.0.3/.ambient-package-update/templates/snippets/content.tpl +128 -207
- django_dynamic_admin_forms-3.0.3/.ambient-package-update/templates/snippets/installation.tpl +36 -0
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/CHANGES.md +3 -0
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/PKG-INFO +26 -13
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/README.md +24 -11
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/django_dynamic_admin_forms/__init__.py +1 -1
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/pyproject.toml +1 -1
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/.coveragerc +0 -0
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/.editorconfig +0 -0
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/.github/workflows/ci.yml +0 -0
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/.gitignore +0 -0
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/.pre-commit-config.yaml +0 -0
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/.python-version +0 -0
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/.readthedocs.yaml +0 -0
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/LICENSE.md +0 -0
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/MANIFEST.in +0 -0
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/django_dynamic_admin_forms/admin.py +0 -0
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/django_dynamic_admin_forms/apps.py +0 -0
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/django_dynamic_admin_forms/static/js/dynamic_admin.js +0 -0
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/django_dynamic_admin_forms/templates/admin/change_form.html +0 -0
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/django_dynamic_admin_forms/urls.py +0 -0
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/docs/Makefile +0 -0
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/docs/conf.py +0 -0
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/docs/demo.gif +0 -0
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/docs/features/changelog.rst +0 -0
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/docs/index.rst +0 -0
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/docs/make.bat +0 -0
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/e2e/cypress/integration/dynamic-select.spec.js +0 -0
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/e2e/cypress/plugins/index.js +0 -0
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/e2e/cypress/support/commands.js +0 -0
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/e2e/cypress/support/index.js +0 -0
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/e2e/cypress/support/paths.js +0 -0
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/e2e/cypress.json +0 -0
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/e2e/package.json +0 -0
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/e2e/yarn.lock +0 -0
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/fixtures/fixtures-dev.json +0 -0
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/manage.py +0 -0
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/scripts/unix/install_requirements.sh +0 -0
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/scripts/unix/publish_to_pypi.sh +0 -0
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/scripts/windows/install_requirements.ps1 +0 -0
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/scripts/windows/publish_to_pypi.ps1 +0 -0
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/settings.py +0 -0
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/setup.cfg +0 -0
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/testapp/__init__.py +0 -0
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/testapp/admin.py +0 -0
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/testapp/apps.py +0 -0
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/testapp/migrations/0001_initial.py +0 -0
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/testapp/migrations/0002_extend_example.py +0 -0
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/testapp/migrations/0003_example_file_field.py +0 -0
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/testapp/migrations/__init__.py +0 -0
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/testapp/models.py +0 -0
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/testapp/urls.py +0 -0
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/tests/__init__.py +0 -0
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/tests/test_admin_generic.py +0 -0
- {django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/tests/test_admin_unit.py +0 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
from ambient_package_update.metadata.author import PackageAuthor
|
|
2
|
+
from ambient_package_update.metadata.constants import (
|
|
3
|
+
DEV_DEPENDENCIES,
|
|
4
|
+
SUPPORTED_DJANGO_VERSIONS,
|
|
5
|
+
SUPPORTED_PYTHON_VERSIONS,
|
|
6
|
+
)
|
|
7
|
+
from ambient_package_update.metadata.maintainer import PackageMaintainer
|
|
8
|
+
from ambient_package_update.metadata.package import PackageMetadata
|
|
9
|
+
from ambient_package_update.metadata.readme import ReadmeContent
|
|
10
|
+
|
|
11
|
+
METADATA = PackageMetadata(
|
|
12
|
+
package_name="django_dynamic_admin_forms",
|
|
13
|
+
module_name="django_dynamic_admin_forms",
|
|
14
|
+
github_package_name="django_dynamic_admin",
|
|
15
|
+
company="Ambient Innovation: GmbH",
|
|
16
|
+
authors=[
|
|
17
|
+
PackageAuthor(
|
|
18
|
+
name="Ambient Digital",
|
|
19
|
+
email="hello@ambient.digital",
|
|
20
|
+
),
|
|
21
|
+
PackageAuthor(
|
|
22
|
+
name="Fabian Binz",
|
|
23
|
+
email="fabian.binz@ambient.digital",
|
|
24
|
+
),
|
|
25
|
+
],
|
|
26
|
+
maintainer=PackageMaintainer(name="Ambient Digital", url="https://ambient.digital/", email="hello@ambient.digital"),
|
|
27
|
+
license_year=2022,
|
|
28
|
+
development_status="5 - Production/Stable",
|
|
29
|
+
has_migrations=False,
|
|
30
|
+
readme_content=ReadmeContent(
|
|
31
|
+
tagline="Add simple interactions to the otherwise static django admin.",
|
|
32
|
+
),
|
|
33
|
+
supported_django_versions=SUPPORTED_DJANGO_VERSIONS,
|
|
34
|
+
supported_python_versions=SUPPORTED_PYTHON_VERSIONS,
|
|
35
|
+
dependencies=[
|
|
36
|
+
"django >=3.2",
|
|
37
|
+
],
|
|
38
|
+
optional_dependencies={
|
|
39
|
+
"dev": [
|
|
40
|
+
*DEV_DEPENDENCIES,
|
|
41
|
+
"unittest-parametrize~=1.4",
|
|
42
|
+
],
|
|
43
|
+
},
|
|
44
|
+
ruff_ignore_list=[],
|
|
45
|
+
)
|
|
@@ -1,207 +1,128 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
- only tested with Django 3.2
|
|
130
|
-
|
|
131
|
-
## Development
|
|
132
|
-
|
|
133
|
-
For local development, create a virtual environment
|
|
134
|
-
in the `testproj` folder:
|
|
135
|
-
```shell
|
|
136
|
-
$ cd testproj
|
|
137
|
-
$ python3 -m venv .venv
|
|
138
|
-
$ source .venv/bin/activate
|
|
139
|
-
$ cd ..
|
|
140
|
-
$ flit install --symlink
|
|
141
|
-
```
|
|
142
|
-
Now the package should be available in your virtual environment
|
|
143
|
-
and any changes should be directly visible.
|
|
144
|
-
|
|
145
|
-
Alternatively, copy the directory `dynamic_admin_forms`
|
|
146
|
-
into any normal django project, so that the python interpreter
|
|
147
|
-
finds the local version instead of the installed (old) version.
|
|
148
|
-
|
|
149
|
-
## Running E2E tests
|
|
150
|
-
|
|
151
|
-
To run end-to-end tests locally:
|
|
152
|
-
```shell
|
|
153
|
-
$ cd testproj
|
|
154
|
-
$ python manage.py runserver 0.0.0.0:8000 & # start server
|
|
155
|
-
$ python manage.py loaddata fixtures/fixtures-dev.json
|
|
156
|
-
$ cd ../e2e
|
|
157
|
-
$ yarn install # or npm install (only needed first time)
|
|
158
|
-
$ yarn cypress # or npm run cypress
|
|
159
|
-
```
|
|
160
|
-
""",
|
|
161
|
-
custom_installation="""
|
|
162
|
-
- Install the package via pip:
|
|
163
|
-
|
|
164
|
-
```pip install django-dynamic-admin-forms```
|
|
165
|
-
|
|
166
|
-
or via pipenv:
|
|
167
|
-
|
|
168
|
-
```pipenv install django-dynamic-admin-forms```
|
|
169
|
-
- Add the module to `INSTALLED_APPS`:
|
|
170
|
-
```python
|
|
171
|
-
INSTALLED_APPS = (
|
|
172
|
-
...,
|
|
173
|
-
'django_dynamic_admin_forms',
|
|
174
|
-
'django.contrib.admin'
|
|
175
|
-
...
|
|
176
|
-
)
|
|
177
|
-
```
|
|
178
|
-
Ensure that the `dynamic_admin_forms` comes before the
|
|
179
|
-
default `django.contrib.admin` in the list of installed apps,
|
|
180
|
-
because otherwise the templates, which are overwritten by `dynamic_admin_forms`
|
|
181
|
-
won't be found.
|
|
182
|
-
- Ensure that the `dynamic_admin_forms` templates are found via using `APP_DIRS` setting:
|
|
183
|
-
```python
|
|
184
|
-
TEMPLATES = [
|
|
185
|
-
{
|
|
186
|
-
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
|
187
|
-
'APP_DIRS': True,
|
|
188
|
-
...
|
|
189
|
-
},
|
|
190
|
-
]
|
|
191
|
-
```
|
|
192
|
-
- Run `python manage.py collectstatic` to include this apps Javascript code in your `settings.STATIC_ROOT` directory
|
|
193
|
-
""",
|
|
194
|
-
),
|
|
195
|
-
supported_django_versions=SUPPORTED_DJANGO_VERSIONS,
|
|
196
|
-
supported_python_versions=SUPPORTED_PYTHON_VERSIONS,
|
|
197
|
-
dependencies=[
|
|
198
|
-
"django >=3.2",
|
|
199
|
-
],
|
|
200
|
-
optional_dependencies={
|
|
201
|
-
"dev": [
|
|
202
|
-
*DEV_DEPENDENCIES,
|
|
203
|
-
"unittest-parametrize~=1.4",
|
|
204
|
-
],
|
|
205
|
-
},
|
|
206
|
-
ruff_ignore_list=[],
|
|
207
|
-
)
|
|
1
|
+
# django-dynamic-admin-forms
|
|
2
|
+
|
|
3
|
+
Add simple interactions to the otherwise static django admin.
|
|
4
|
+
|
|
5
|
+
[](https://postimg.cc/Yv9ZJdWp)
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
- Install the package via pip:
|
|
10
|
+
|
|
11
|
+
```pip install django-dynamic-admin-forms```
|
|
12
|
+
|
|
13
|
+
or via pipenv:
|
|
14
|
+
|
|
15
|
+
```pipenv install django-dynamic-admin-forms```
|
|
16
|
+
- Add the module to `INSTALLED_APPS`:
|
|
17
|
+
```python
|
|
18
|
+
INSTALLED_APPS = (
|
|
19
|
+
...,
|
|
20
|
+
'django_dynamic_admin_forms',
|
|
21
|
+
'django.contrib.admin'
|
|
22
|
+
...
|
|
23
|
+
)
|
|
24
|
+
```
|
|
25
|
+
Ensure that the `dynamic_admin_forms` comes before the
|
|
26
|
+
default `django.contrib.admin` in the list of installed apps,
|
|
27
|
+
because otherwise the templates, which are overwritten by `dynamic_admin_forms`
|
|
28
|
+
won't be found.
|
|
29
|
+
- Ensure that the `dynamic_admin_forms` templates are found via using `APP_DIRS` setting:
|
|
30
|
+
```python
|
|
31
|
+
TEMPLATES = [
|
|
32
|
+
{
|
|
33
|
+
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
|
34
|
+
'APP_DIRS': True,
|
|
35
|
+
...
|
|
36
|
+
},
|
|
37
|
+
]
|
|
38
|
+
```
|
|
39
|
+
- Run `python manage.py collectstatic` to include this apps Javascript code in your `settings.STATIC_ROOT` directory
|
|
40
|
+
|
|
41
|
+
## Usage
|
|
42
|
+
- Add the `django_dynamic_admin_forms.DynamicModelAdminMixin` to your admin classes
|
|
43
|
+
- Add the `django_dynamic_admin_forms.urls` to your urls
|
|
44
|
+
```python
|
|
45
|
+
from django.contrib import admin
|
|
46
|
+
from django.urls import path, include
|
|
47
|
+
|
|
48
|
+
urlpatterns = [
|
|
49
|
+
path("admin/", admin.site.urls),
|
|
50
|
+
path("dynamic-admin-form/", include("django_dynamic_admin_forms.urls")),
|
|
51
|
+
]
|
|
52
|
+
```
|
|
53
|
+
- In addition to the standard `fields` declaration, specify a list of `dynamic_fields`
|
|
54
|
+
- For each dynamic field, add a method `get_dynamic_{field_name}_field` to the admin
|
|
55
|
+
- Input: `data: Dict[str, Any]` - the cleaned form data
|
|
56
|
+
- Output:
|
|
57
|
+
- `queryset: Optional[Queryset]` - The values to select from
|
|
58
|
+
- `value: Any` - The value, the field should have (must be compatible to the field type)
|
|
59
|
+
- `hidden: Bool` - True, if field should be hidden
|
|
60
|
+
|
|
61
|
+
- A rather non-sensical example:
|
|
62
|
+
```python
|
|
63
|
+
from django.contrib import admin
|
|
64
|
+
|
|
65
|
+
from .models import MyModel
|
|
66
|
+
from django_dynamic_admin_forms.admin import DynamicModelAdminMixin
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
@admin.register(MyModel)
|
|
70
|
+
class MyModelAdmin(DynamicModelAdminMixin, admin.ModelAdmin):
|
|
71
|
+
fields = ("name", "city")
|
|
72
|
+
dynamic_fields = ("city",)
|
|
73
|
+
|
|
74
|
+
def get_dynamic_city_field(self, data):
|
|
75
|
+
# automatically choose first city that matches first letter of name
|
|
76
|
+
name = data.get("name")
|
|
77
|
+
if not name:
|
|
78
|
+
queryset = City.objects.all()
|
|
79
|
+
value = data.get("city")
|
|
80
|
+
else:
|
|
81
|
+
queryset = City.objects.filter(name__startswith=name[0])
|
|
82
|
+
value = queryset.first()
|
|
83
|
+
hidden = not queryset.exists()
|
|
84
|
+
return queryset, value, hidden
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
## How it works
|
|
89
|
+
Whenever a dynamic form changes, an event handler makes a request to a special endpoint, which returns new HTML to swap
|
|
90
|
+
into the existing form. This new HTML is directly generated by `django.contrib.admin`, so we only have to set the
|
|
91
|
+
outerHTML of the correct HTML elements to update the form.
|
|
92
|
+
|
|
93
|
+
## Limitations
|
|
94
|
+
- does not work in conjunction with inlines
|
|
95
|
+
- does not validate that the selected value is really part of the original queryset
|
|
96
|
+
- if anybody can modify your DOM, they could potentially inject invalid values
|
|
97
|
+
- you have to write `Model.clean()` methods to guard against that
|
|
98
|
+
- only tested with Django 3.2
|
|
99
|
+
|
|
100
|
+
## Development
|
|
101
|
+
|
|
102
|
+
For local development, create a virtual environment
|
|
103
|
+
in the `testproj` folder:
|
|
104
|
+
```shell
|
|
105
|
+
$ cd testproj
|
|
106
|
+
$ python3 -m venv .venv
|
|
107
|
+
$ source .venv/bin/activate
|
|
108
|
+
$ cd ..
|
|
109
|
+
$ flit install --symlink
|
|
110
|
+
```
|
|
111
|
+
Now the package should be available in your virtual environment
|
|
112
|
+
and any changes should be directly visible.
|
|
113
|
+
|
|
114
|
+
Alternatively, copy the directory `dynamic_admin_forms`
|
|
115
|
+
into any normal django project, so that the python interpreter
|
|
116
|
+
finds the local version instead of the installed (old) version.
|
|
117
|
+
|
|
118
|
+
## Running E2E tests
|
|
119
|
+
|
|
120
|
+
To run end-to-end tests locally:
|
|
121
|
+
```shell
|
|
122
|
+
$ cd testproj
|
|
123
|
+
$ python manage.py runserver 0.0.0.0:8000 & # start server
|
|
124
|
+
$ python manage.py loaddata fixtures/fixtures-dev.json
|
|
125
|
+
$ cd ../e2e
|
|
126
|
+
$ yarn install # or npm install (only needed first time)
|
|
127
|
+
$ yarn cypress # or npm run cypress
|
|
128
|
+
```
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
## Installation
|
|
2
|
+
|
|
3
|
+
- Install the package via pip:
|
|
4
|
+
|
|
5
|
+
`pip install django-dynamic-admin-forms`
|
|
6
|
+
|
|
7
|
+
or via pipenv:
|
|
8
|
+
|
|
9
|
+
`pipenv install django-dynamic-admin-forms`
|
|
10
|
+
|
|
11
|
+
- Add the module to `INSTALLED_APPS`:
|
|
12
|
+
```python
|
|
13
|
+
INSTALLED_APPS = (
|
|
14
|
+
...,
|
|
15
|
+
'django_dynamic_admin_forms',
|
|
16
|
+
'django.contrib.admin'
|
|
17
|
+
...
|
|
18
|
+
)
|
|
19
|
+
```
|
|
20
|
+
Ensure that the `dynamic_admin_forms` comes before the
|
|
21
|
+
default `django.contrib.admin` in the list of installed apps,
|
|
22
|
+
because otherwise the templates, which are overwritten by `dynamic_admin_forms`
|
|
23
|
+
won't be found.
|
|
24
|
+
|
|
25
|
+
- Ensure that the `dynamic_admin_forms` templates are found via using `APP_DIRS` setting:
|
|
26
|
+
```python
|
|
27
|
+
TEMPLATES = [
|
|
28
|
+
{
|
|
29
|
+
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
|
30
|
+
'APP_DIRS': True,
|
|
31
|
+
...
|
|
32
|
+
},
|
|
33
|
+
]
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
- Run `python manage.py collectstatic` to include this apps Javascript code in your `settings.STATIC_ROOT` directory
|
|
@@ -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.3
|
|
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.3 ; 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
|
|
@@ -187,29 +187,42 @@ $ yarn install # or npm install (only needed first time)
|
|
|
187
187
|
$ yarn cypress # or npm run cypress
|
|
188
188
|
```
|
|
189
189
|
|
|
190
|
-
|
|
191
190
|
## Installation
|
|
192
191
|
|
|
193
192
|
- Install the package via pip:
|
|
194
193
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
or via pipenv:
|
|
194
|
+
`pip install django-dynamic-admin-forms`
|
|
198
195
|
|
|
199
|
-
|
|
196
|
+
or via pipenv:
|
|
200
197
|
|
|
201
|
-
|
|
198
|
+
`pipenv install django-dynamic-admin-forms`
|
|
202
199
|
|
|
203
|
-
|
|
200
|
+
- Add the module to `INSTALLED_APPS`:
|
|
201
|
+
```python
|
|
204
202
|
INSTALLED_APPS = (
|
|
205
|
-
|
|
203
|
+
...,
|
|
206
204
|
'django_dynamic_admin_forms',
|
|
205
|
+
'django.contrib.admin'
|
|
206
|
+
...
|
|
207
207
|
)
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
208
|
+
```
|
|
209
|
+
Ensure that the `dynamic_admin_forms` comes before the
|
|
210
|
+
default `django.contrib.admin` in the list of installed apps,
|
|
211
|
+
because otherwise the templates, which are overwritten by `dynamic_admin_forms`
|
|
212
|
+
won't be found.
|
|
211
213
|
|
|
214
|
+
- Ensure that the `dynamic_admin_forms` templates are found via using `APP_DIRS` setting:
|
|
215
|
+
```python
|
|
216
|
+
TEMPLATES = [
|
|
217
|
+
{
|
|
218
|
+
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
|
219
|
+
'APP_DIRS': True,
|
|
220
|
+
...
|
|
221
|
+
},
|
|
222
|
+
]
|
|
223
|
+
```
|
|
212
224
|
|
|
225
|
+
- Run `python manage.py collectstatic` to include this apps Javascript code in your `settings.STATIC_ROOT` directory
|
|
213
226
|
|
|
214
227
|
## Contribute
|
|
215
228
|
|
|
@@ -142,29 +142,42 @@ $ yarn install # or npm install (only needed first time)
|
|
|
142
142
|
$ yarn cypress # or npm run cypress
|
|
143
143
|
```
|
|
144
144
|
|
|
145
|
-
|
|
146
145
|
## Installation
|
|
147
146
|
|
|
148
147
|
- Install the package via pip:
|
|
149
148
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
or via pipenv:
|
|
149
|
+
`pip install django-dynamic-admin-forms`
|
|
153
150
|
|
|
154
|
-
|
|
151
|
+
or via pipenv:
|
|
155
152
|
|
|
156
|
-
|
|
153
|
+
`pipenv install django-dynamic-admin-forms`
|
|
157
154
|
|
|
158
|
-
|
|
155
|
+
- Add the module to `INSTALLED_APPS`:
|
|
156
|
+
```python
|
|
159
157
|
INSTALLED_APPS = (
|
|
160
|
-
|
|
158
|
+
...,
|
|
161
159
|
'django_dynamic_admin_forms',
|
|
160
|
+
'django.contrib.admin'
|
|
161
|
+
...
|
|
162
162
|
)
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
163
|
+
```
|
|
164
|
+
Ensure that the `dynamic_admin_forms` comes before the
|
|
165
|
+
default `django.contrib.admin` in the list of installed apps,
|
|
166
|
+
because otherwise the templates, which are overwritten by `dynamic_admin_forms`
|
|
167
|
+
won't be found.
|
|
166
168
|
|
|
169
|
+
- Ensure that the `dynamic_admin_forms` templates are found via using `APP_DIRS` setting:
|
|
170
|
+
```python
|
|
171
|
+
TEMPLATES = [
|
|
172
|
+
{
|
|
173
|
+
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
|
174
|
+
'APP_DIRS': True,
|
|
175
|
+
...
|
|
176
|
+
},
|
|
177
|
+
]
|
|
178
|
+
```
|
|
167
179
|
|
|
180
|
+
- Run `python manage.py collectstatic` to include this apps Javascript code in your `settings.STATIC_ROOT` directory
|
|
168
181
|
|
|
169
182
|
## Contribute
|
|
170
183
|
|
|
File without changes
|
|
File without changes
|
{django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/.github/workflows/ci.yml
RENAMED
|
File without changes
|
|
File without changes
|
{django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/.pre-commit-config.yaml
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
|
{django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/docs/features/changelog.rst
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/e2e/cypress/plugins/index.js
RENAMED
|
File without changes
|
|
File without changes
|
{django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/e2e/cypress/support/index.js
RENAMED
|
File without changes
|
{django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/e2e/cypress/support/paths.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/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.2 → django_dynamic_admin_forms-3.0.3}/testapp/migrations/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/tests/test_admin_generic.py
RENAMED
|
File without changes
|
{django_dynamic_admin_forms-3.0.2 → django_dynamic_admin_forms-3.0.3}/tests/test_admin_unit.py
RENAMED
|
File without changes
|