django-admin-helpers 0.1.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.
- django_admin_helpers-0.1.0/LICENSE +22 -0
- django_admin_helpers-0.1.0/PKG-INFO +122 -0
- django_admin_helpers-0.1.0/README.md +87 -0
- django_admin_helpers-0.1.0/pyproject.toml +164 -0
- django_admin_helpers-0.1.0/src/django_admin_helpers/__init__.py +1 -0
- django_admin_helpers-0.1.0/src/django_admin_helpers/apps.py +9 -0
- django_admin_helpers-0.1.0/src/django_admin_helpers/conf.py +40 -0
- django_admin_helpers-0.1.0/src/django_admin_helpers/main.py +11 -0
- django_admin_helpers-0.1.0/src/django_admin_helpers/py.typed +0 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
|
|
2
|
+
MIT License
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2024 Bruno Alla
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: django-admin-helpers
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A collections of helpers for the Django admin.
|
|
5
|
+
Home-page: https://github.com/browniebroke/django-admin-helpers
|
|
6
|
+
License: MIT
|
|
7
|
+
Author: Bruno Alla
|
|
8
|
+
Author-email: oss@browniebroke.com
|
|
9
|
+
Requires-Python: >=3.8,<4.0
|
|
10
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
11
|
+
Classifier: Framework :: Django
|
|
12
|
+
Classifier: Framework :: Django :: 3.2
|
|
13
|
+
Classifier: Framework :: Django :: 4.0
|
|
14
|
+
Classifier: Framework :: Django :: 4.1
|
|
15
|
+
Classifier: Framework :: Django :: 4.2
|
|
16
|
+
Classifier: Framework :: Django :: 5.0
|
|
17
|
+
Classifier: Intended Audience :: Developers
|
|
18
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
19
|
+
Classifier: Natural Language :: English
|
|
20
|
+
Classifier: Operating System :: OS Independent
|
|
21
|
+
Classifier: Programming Language :: Python :: 3
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
26
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
27
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
28
|
+
Requires-Dist: django (>=3.2)
|
|
29
|
+
Project-URL: Bug Tracker, https://github.com/browniebroke/django-admin-helpers/issues
|
|
30
|
+
Project-URL: Changelog, https://github.com/browniebroke/django-admin-helpers/blob/main/CHANGELOG.md
|
|
31
|
+
Project-URL: Documentation, https://django-admin-helpers.readthedocs.io
|
|
32
|
+
Project-URL: Repository, https://github.com/browniebroke/django-admin-helpers
|
|
33
|
+
Description-Content-Type: text/markdown
|
|
34
|
+
|
|
35
|
+
# Django Admin Helpers
|
|
36
|
+
|
|
37
|
+
<p align="center">
|
|
38
|
+
<a href="https://github.com/browniebroke/django-admin-helpers/actions/workflows/ci.yml?query=branch%3Amain">
|
|
39
|
+
<img src="https://img.shields.io/github/actions/workflow/status/browniebroke/django-admin-helpers/ci.yml?branch=main&label=CI&logo=github&style=flat-square" alt="CI Status" >
|
|
40
|
+
</a>
|
|
41
|
+
<a href="https://django-admin-helpers.readthedocs.io">
|
|
42
|
+
<img src="https://img.shields.io/readthedocs/django-admin-helpers.svg?logo=read-the-docs&logoColor=fff&style=flat-square" alt="Documentation Status">
|
|
43
|
+
</a>
|
|
44
|
+
<a href="https://codecov.io/gh/browniebroke/django-admin-helpers">
|
|
45
|
+
<img src="https://img.shields.io/codecov/c/github/browniebroke/django-admin-helpers.svg?logo=codecov&logoColor=fff&style=flat-square" alt="Test coverage percentage">
|
|
46
|
+
</a>
|
|
47
|
+
</p>
|
|
48
|
+
<p align="center">
|
|
49
|
+
<a href="https://python-poetry.org/">
|
|
50
|
+
<img src="https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json" alt="Poetry">
|
|
51
|
+
</a>
|
|
52
|
+
<a href="https://github.com/astral-sh/ruff">
|
|
53
|
+
<img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json" alt="Ruff">
|
|
54
|
+
</a>
|
|
55
|
+
<a href="https://github.com/pre-commit/pre-commit">
|
|
56
|
+
<img src="https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white&style=flat-square" alt="pre-commit">
|
|
57
|
+
</a>
|
|
58
|
+
</p>
|
|
59
|
+
<p align="center">
|
|
60
|
+
<a href="https://pypi.org/project/django-admin-helpers/">
|
|
61
|
+
<img src="https://img.shields.io/pypi/v/django-admin-helpers.svg?logo=python&logoColor=fff&style=flat-square" alt="PyPI Version">
|
|
62
|
+
</a>
|
|
63
|
+
<img src="https://img.shields.io/pypi/pyversions/django-admin-helpers.svg?style=flat-square&logo=python&logoColor=fff" alt="Supported Python versions">
|
|
64
|
+
<img src="https://img.shields.io/pypi/l/django-admin-helpers.svg?style=flat-square" alt="License">
|
|
65
|
+
</p>
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
**Documentation**: <a href="https://django-admin-helpers.readthedocs.io" target="_blank">https://django-admin-helpers.readthedocs.io </a>
|
|
70
|
+
|
|
71
|
+
**Source Code**: <a href="https://github.com/browniebroke/django-admin-helpers" target="_blank">https://github.com/browniebroke/django-admin-helpers </a>
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
A collections of helpers for the Django admin.
|
|
76
|
+
|
|
77
|
+
## Installation
|
|
78
|
+
|
|
79
|
+
Install this via pip (or your favourite package manager):
|
|
80
|
+
|
|
81
|
+
`pip install django-admin-helpers`
|
|
82
|
+
|
|
83
|
+
Add the app to your `INSTALLED_APPS`:
|
|
84
|
+
|
|
85
|
+
```python
|
|
86
|
+
INSTALLED_APPS = [
|
|
87
|
+
# ...
|
|
88
|
+
"django_admin_helpers",
|
|
89
|
+
]
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Contributors ✨
|
|
93
|
+
|
|
94
|
+
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
|
|
95
|
+
|
|
96
|
+
<!-- prettier-ignore-start -->
|
|
97
|
+
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
|
|
98
|
+
<!-- prettier-ignore-start -->
|
|
99
|
+
<!-- markdownlint-disable -->
|
|
100
|
+
<table>
|
|
101
|
+
<tbody>
|
|
102
|
+
<tr>
|
|
103
|
+
<td align="center" valign="top" width="14.28%"><a href="https://browniebroke.com/"><img src="https://avatars.githubusercontent.com/u/861044?v=4?s=80" width="80px;" alt="Bruno Alla"/><br /><sub><b>Bruno Alla</b></sub></a><br /><a href="https://github.com/browniebroke/django-admin-helpers/commits?author=browniebroke" title="Code">💻</a> <a href="#ideas-browniebroke" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/browniebroke/django-admin-helpers/commits?author=browniebroke" title="Documentation">📖</a></td>
|
|
104
|
+
</tr>
|
|
105
|
+
</tbody>
|
|
106
|
+
</table>
|
|
107
|
+
|
|
108
|
+
<!-- markdownlint-restore -->
|
|
109
|
+
<!-- prettier-ignore-end -->
|
|
110
|
+
|
|
111
|
+
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
|
112
|
+
<!-- prettier-ignore-end -->
|
|
113
|
+
|
|
114
|
+
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
|
|
115
|
+
|
|
116
|
+
## Credits
|
|
117
|
+
|
|
118
|
+
This package was created with
|
|
119
|
+
[Copier](https://copier.readthedocs.io/) and the
|
|
120
|
+
[browniebroke/pypackage-template](https://github.com/browniebroke/pypackage-template)
|
|
121
|
+
project template.
|
|
122
|
+
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Django Admin Helpers
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<a href="https://github.com/browniebroke/django-admin-helpers/actions/workflows/ci.yml?query=branch%3Amain">
|
|
5
|
+
<img src="https://img.shields.io/github/actions/workflow/status/browniebroke/django-admin-helpers/ci.yml?branch=main&label=CI&logo=github&style=flat-square" alt="CI Status" >
|
|
6
|
+
</a>
|
|
7
|
+
<a href="https://django-admin-helpers.readthedocs.io">
|
|
8
|
+
<img src="https://img.shields.io/readthedocs/django-admin-helpers.svg?logo=read-the-docs&logoColor=fff&style=flat-square" alt="Documentation Status">
|
|
9
|
+
</a>
|
|
10
|
+
<a href="https://codecov.io/gh/browniebroke/django-admin-helpers">
|
|
11
|
+
<img src="https://img.shields.io/codecov/c/github/browniebroke/django-admin-helpers.svg?logo=codecov&logoColor=fff&style=flat-square" alt="Test coverage percentage">
|
|
12
|
+
</a>
|
|
13
|
+
</p>
|
|
14
|
+
<p align="center">
|
|
15
|
+
<a href="https://python-poetry.org/">
|
|
16
|
+
<img src="https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json" alt="Poetry">
|
|
17
|
+
</a>
|
|
18
|
+
<a href="https://github.com/astral-sh/ruff">
|
|
19
|
+
<img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json" alt="Ruff">
|
|
20
|
+
</a>
|
|
21
|
+
<a href="https://github.com/pre-commit/pre-commit">
|
|
22
|
+
<img src="https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white&style=flat-square" alt="pre-commit">
|
|
23
|
+
</a>
|
|
24
|
+
</p>
|
|
25
|
+
<p align="center">
|
|
26
|
+
<a href="https://pypi.org/project/django-admin-helpers/">
|
|
27
|
+
<img src="https://img.shields.io/pypi/v/django-admin-helpers.svg?logo=python&logoColor=fff&style=flat-square" alt="PyPI Version">
|
|
28
|
+
</a>
|
|
29
|
+
<img src="https://img.shields.io/pypi/pyversions/django-admin-helpers.svg?style=flat-square&logo=python&logoColor=fff" alt="Supported Python versions">
|
|
30
|
+
<img src="https://img.shields.io/pypi/l/django-admin-helpers.svg?style=flat-square" alt="License">
|
|
31
|
+
</p>
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
**Documentation**: <a href="https://django-admin-helpers.readthedocs.io" target="_blank">https://django-admin-helpers.readthedocs.io </a>
|
|
36
|
+
|
|
37
|
+
**Source Code**: <a href="https://github.com/browniebroke/django-admin-helpers" target="_blank">https://github.com/browniebroke/django-admin-helpers </a>
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
A collections of helpers for the Django admin.
|
|
42
|
+
|
|
43
|
+
## Installation
|
|
44
|
+
|
|
45
|
+
Install this via pip (or your favourite package manager):
|
|
46
|
+
|
|
47
|
+
`pip install django-admin-helpers`
|
|
48
|
+
|
|
49
|
+
Add the app to your `INSTALLED_APPS`:
|
|
50
|
+
|
|
51
|
+
```python
|
|
52
|
+
INSTALLED_APPS = [
|
|
53
|
+
# ...
|
|
54
|
+
"django_admin_helpers",
|
|
55
|
+
]
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Contributors ✨
|
|
59
|
+
|
|
60
|
+
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
|
|
61
|
+
|
|
62
|
+
<!-- prettier-ignore-start -->
|
|
63
|
+
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
|
|
64
|
+
<!-- prettier-ignore-start -->
|
|
65
|
+
<!-- markdownlint-disable -->
|
|
66
|
+
<table>
|
|
67
|
+
<tbody>
|
|
68
|
+
<tr>
|
|
69
|
+
<td align="center" valign="top" width="14.28%"><a href="https://browniebroke.com/"><img src="https://avatars.githubusercontent.com/u/861044?v=4?s=80" width="80px;" alt="Bruno Alla"/><br /><sub><b>Bruno Alla</b></sub></a><br /><a href="https://github.com/browniebroke/django-admin-helpers/commits?author=browniebroke" title="Code">💻</a> <a href="#ideas-browniebroke" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/browniebroke/django-admin-helpers/commits?author=browniebroke" title="Documentation">📖</a></td>
|
|
70
|
+
</tr>
|
|
71
|
+
</tbody>
|
|
72
|
+
</table>
|
|
73
|
+
|
|
74
|
+
<!-- markdownlint-restore -->
|
|
75
|
+
<!-- prettier-ignore-end -->
|
|
76
|
+
|
|
77
|
+
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
|
78
|
+
<!-- prettier-ignore-end -->
|
|
79
|
+
|
|
80
|
+
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
|
|
81
|
+
|
|
82
|
+
## Credits
|
|
83
|
+
|
|
84
|
+
This package was created with
|
|
85
|
+
[Copier](https://copier.readthedocs.io/) and the
|
|
86
|
+
[browniebroke/pypackage-template](https://github.com/browniebroke/pypackage-template)
|
|
87
|
+
project template.
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
[tool.poetry]
|
|
2
|
+
name = "django-admin-helpers"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "A collections of helpers for the Django admin."
|
|
5
|
+
authors = ["Bruno Alla <oss@browniebroke.com>"]
|
|
6
|
+
license = "MIT"
|
|
7
|
+
readme = "README.md"
|
|
8
|
+
repository = "https://github.com/browniebroke/django-admin-helpers"
|
|
9
|
+
documentation = "https://django-admin-helpers.readthedocs.io"
|
|
10
|
+
classifiers = [
|
|
11
|
+
"Development Status :: 2 - Pre-Alpha",
|
|
12
|
+
"Intended Audience :: Developers",
|
|
13
|
+
"Natural Language :: English",
|
|
14
|
+
"Operating System :: OS Independent",
|
|
15
|
+
"Framework :: Django",
|
|
16
|
+
"Framework :: Django :: 3.2",
|
|
17
|
+
"Framework :: Django :: 4.0",
|
|
18
|
+
"Framework :: Django :: 4.1",
|
|
19
|
+
"Framework :: Django :: 4.2",
|
|
20
|
+
"Framework :: Django :: 5.0",
|
|
21
|
+
"Topic :: Software Development :: Libraries",
|
|
22
|
+
]
|
|
23
|
+
packages = [
|
|
24
|
+
{ include = "django_admin_helpers", from = "src" },
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
[tool.poetry.urls]
|
|
28
|
+
"Bug Tracker" = "https://github.com/browniebroke/django-admin-helpers/issues"
|
|
29
|
+
"Changelog" = "https://github.com/browniebroke/django-admin-helpers/blob/main/CHANGELOG.md"
|
|
30
|
+
|
|
31
|
+
[tool.poetry.dependencies]
|
|
32
|
+
python = "^3.8"
|
|
33
|
+
django = ">=3.2"
|
|
34
|
+
|
|
35
|
+
[tool.poetry.group.dev.dependencies]
|
|
36
|
+
pytest = "^7.0"
|
|
37
|
+
pytest-cov = "^3.0"
|
|
38
|
+
pytest-django = "^4.5"
|
|
39
|
+
|
|
40
|
+
[tool.poetry.group.docs]
|
|
41
|
+
optional = true
|
|
42
|
+
|
|
43
|
+
[tool.poetry.group.docs.dependencies]
|
|
44
|
+
myst-parser = { version = ">=0.16", python = ">=3.11"}
|
|
45
|
+
sphinx = { version = ">=4.0", python = ">=3.11"}
|
|
46
|
+
furo = { version = ">=2023.5.20", python = ">=3.11"}
|
|
47
|
+
sphinx-autobuild = { version = ">=2024.0.0", python = ">=3.11"}
|
|
48
|
+
|
|
49
|
+
[tool.semantic_release]
|
|
50
|
+
version_toml = ["pyproject.toml:tool.poetry.version"]
|
|
51
|
+
version_variables = [
|
|
52
|
+
"src/django_admin_helpers/__init__.py:__version__",
|
|
53
|
+
"docs/conf.py:release",
|
|
54
|
+
]
|
|
55
|
+
build_command = "pip install poetry && poetry build"
|
|
56
|
+
|
|
57
|
+
[tool.semantic_release.changelog]
|
|
58
|
+
exclude_commit_patterns = [
|
|
59
|
+
"chore*",
|
|
60
|
+
"ci*",
|
|
61
|
+
]
|
|
62
|
+
|
|
63
|
+
[tool.semantic_release.changelog.environment]
|
|
64
|
+
keep_trailing_newline = true
|
|
65
|
+
|
|
66
|
+
[tool.semantic_release.branches.main]
|
|
67
|
+
match = "main"
|
|
68
|
+
|
|
69
|
+
[tool.semantic_release.branches.noop]
|
|
70
|
+
match = "(?!main$)"
|
|
71
|
+
prerelease = true
|
|
72
|
+
|
|
73
|
+
[tool.pytest.ini_options]
|
|
74
|
+
addopts = """\
|
|
75
|
+
-v
|
|
76
|
+
-Wdefault
|
|
77
|
+
--cov=django_admin_helpers
|
|
78
|
+
--cov-report=term
|
|
79
|
+
--cov-report=xml
|
|
80
|
+
--ds=tests.settings
|
|
81
|
+
"""
|
|
82
|
+
pythonpath = ["src"]
|
|
83
|
+
django_find_project = false
|
|
84
|
+
|
|
85
|
+
[tool.coverage.run]
|
|
86
|
+
branch = true
|
|
87
|
+
|
|
88
|
+
[tool.coverage.report]
|
|
89
|
+
exclude_lines = [
|
|
90
|
+
"pragma: no cover",
|
|
91
|
+
"@overload",
|
|
92
|
+
"if TYPE_CHECKING",
|
|
93
|
+
"raise NotImplementedError",
|
|
94
|
+
'if __name__ == "__main__":',
|
|
95
|
+
]
|
|
96
|
+
|
|
97
|
+
[tool.ruff]
|
|
98
|
+
target-version = "py38"
|
|
99
|
+
line-length = 88
|
|
100
|
+
|
|
101
|
+
[tool.ruff.lint]
|
|
102
|
+
ignore = [
|
|
103
|
+
"D203", # 1 blank line required before class docstring
|
|
104
|
+
"D212", # Multi-line docstring summary should start at the first line
|
|
105
|
+
"D100", # Missing docstring in public module
|
|
106
|
+
"D104", # Missing docstring in public package
|
|
107
|
+
"D107", # Missing docstring in `__init__`
|
|
108
|
+
"D401", # First line of docstring should be in imperative mood
|
|
109
|
+
]
|
|
110
|
+
select = [
|
|
111
|
+
"B", # flake8-bugbear
|
|
112
|
+
"D", # flake8-docstrings
|
|
113
|
+
"C4", # flake8-comprehensions
|
|
114
|
+
"S", # flake8-bandit
|
|
115
|
+
"F", # pyflake
|
|
116
|
+
"E", # pycodestyle
|
|
117
|
+
"W", # pycodestyle
|
|
118
|
+
"UP", # pyupgrade
|
|
119
|
+
"I", # isort
|
|
120
|
+
"RUF", # ruff specific
|
|
121
|
+
]
|
|
122
|
+
|
|
123
|
+
[tool.ruff.lint.per-file-ignores]
|
|
124
|
+
"tests/**/*" = [
|
|
125
|
+
"D100",
|
|
126
|
+
"D101",
|
|
127
|
+
"D102",
|
|
128
|
+
"D103",
|
|
129
|
+
"D104",
|
|
130
|
+
"S101",
|
|
131
|
+
]
|
|
132
|
+
"setup.py" = ["D100"]
|
|
133
|
+
"conftest.py" = ["D100"]
|
|
134
|
+
"docs/conf.py" = ["D100"]
|
|
135
|
+
|
|
136
|
+
[tool.ruff.lint.isort]
|
|
137
|
+
known-first-party = ["django_admin_helpers", "tests"]
|
|
138
|
+
|
|
139
|
+
[tool.mypy]
|
|
140
|
+
check_untyped_defs = true
|
|
141
|
+
disallow_any_generics = true
|
|
142
|
+
disallow_incomplete_defs = true
|
|
143
|
+
disallow_untyped_defs = true
|
|
144
|
+
mypy_path = "src/"
|
|
145
|
+
no_implicit_optional = true
|
|
146
|
+
show_error_codes = true
|
|
147
|
+
warn_unreachable = true
|
|
148
|
+
warn_unused_ignores = true
|
|
149
|
+
exclude = [
|
|
150
|
+
'docs/.*',
|
|
151
|
+
'setup.py',
|
|
152
|
+
]
|
|
153
|
+
|
|
154
|
+
[[tool.mypy.overrides]]
|
|
155
|
+
module = "tests.*"
|
|
156
|
+
allow_untyped_defs = true
|
|
157
|
+
|
|
158
|
+
[[tool.mypy.overrides]]
|
|
159
|
+
module = "docs.*"
|
|
160
|
+
ignore_errors = true
|
|
161
|
+
|
|
162
|
+
[build-system]
|
|
163
|
+
requires = ["poetry-core>=1.0.0"]
|
|
164
|
+
build-backend = "poetry.core.masonry.api"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.1.0"
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"""
|
|
2
|
+
These are the available settings.
|
|
3
|
+
|
|
4
|
+
All attributes prefixed ``ADMIN_HELPERS_*`` can be overridden from your Django
|
|
5
|
+
project's settings module by defining a setting with the same name.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
from dataclasses import dataclass
|
|
11
|
+
from typing import Any
|
|
12
|
+
|
|
13
|
+
from django.conf import settings as django_settings
|
|
14
|
+
|
|
15
|
+
# All attributes accessed with this prefix are possible to overwrite
|
|
16
|
+
# through django.conf.settings.
|
|
17
|
+
SETTINGS_PREFIX = "ADMIN_HELPERS_"
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@dataclass(frozen=True)
|
|
21
|
+
class AppSettings:
|
|
22
|
+
"""Access this instance as `.conf.app_settings`."""
|
|
23
|
+
|
|
24
|
+
ADMIN_HELPERS_ENABLED: bool = True
|
|
25
|
+
"""Whether the app is enabled (dummy setting to demo usage)."""
|
|
26
|
+
|
|
27
|
+
def __getattribute__(self, __name: str) -> Any:
|
|
28
|
+
"""
|
|
29
|
+
Check if a Django project settings should override the app default.
|
|
30
|
+
|
|
31
|
+
In order to avoid returning any random properties of the django settings,
|
|
32
|
+
we inspect the prefix firstly.
|
|
33
|
+
"""
|
|
34
|
+
if __name.startswith(SETTINGS_PREFIX) and hasattr(django_settings, __name):
|
|
35
|
+
return getattr(django_settings, __name)
|
|
36
|
+
|
|
37
|
+
return super().__getattribute__(__name)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
app_settings = AppSettings()
|
|
File without changes
|