django-admin-helpers 0.1.0__py3-none-any.whl

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.
@@ -0,0 +1 @@
1
+ __version__ = "0.1.0"
@@ -0,0 +1,9 @@
1
+ from django.apps import AppConfig
2
+ from django.utils.translation import gettext_lazy as _
3
+
4
+
5
+ class AdminHelpersAppConfig(AppConfig):
6
+ """App config for Django Admin Helpers."""
7
+
8
+ name = "django_admin_helpers"
9
+ verbose_name = _("admin helpers")
@@ -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()
@@ -0,0 +1,11 @@
1
+ from .conf import app_settings
2
+
3
+
4
+ def add(n1: int, n2: int) -> int:
5
+ """Add the arguments."""
6
+ return n1 + n2
7
+
8
+
9
+ def is_enabled() -> bool:
10
+ """Example usage of app settings."""
11
+ return app_settings.ADMIN_HELPERS_ENABLED
File without changes
@@ -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&amp;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,9 @@
1
+ django_admin_helpers/__init__.py,sha256=kUR5RAFc7HCeiqdlX36dZOHkUI5wI6V_43RpEcD8b-0,22
2
+ django_admin_helpers/apps.py,sha256=mkkV76IimInl_WQzEVauUMroWH5NxlS88OCkbzFVxu8,251
3
+ django_admin_helpers/conf.py,sha256=T598wzsafvnmFrkOcKk0uBGAmQR7Vo62iRSRiK1iZ0A,1174
4
+ django_admin_helpers/main.py,sha256=LBa65yxZvpOl6ixy5kmlcCkeyg8tEm76E-Sq0rgojQ0,230
5
+ django_admin_helpers/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ django_admin_helpers-0.1.0.dist-info/LICENSE,sha256=ji4Rf9Jc6RASNBAcebQKpyCbnx0s6ESGoI3WktUE-Hg,1068
7
+ django_admin_helpers-0.1.0.dist-info/METADATA,sha256=2shn33LPXszyGqOwumMlMKg0rON_0iCp-ewBcyPCQaI,5308
8
+ django_admin_helpers-0.1.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
9
+ django_admin_helpers-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: poetry-core 1.9.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any