Django Admin Related
this project makes it impossible for the user to delete objects that contain other objects related by django admin.
Obs: this project works only in django admin
Install:
pip install django-admin-related
Usage:
-
Add to your INSTALLED_APPS, in settings.py:
INSTALLED_APPS = [ ... 'django_admin_related', ... ] -
Create admin for your model:
from django.contrib.admin import register from django_admin_related.admin import VerifyRelated @register(YouModel) class YouModelAdmin(VerifyRelated): """ from best performance use `verify_related_fields` because this check all fields is a point to other model and `verify_related_fields` is a direct way. """ pass -
Test:
try this: create a simple model, and simple related model, and exclude a first model.
Advanced:
- if you need to specify relationships, you can do so :
from django.contrib.admin import register from django_admin_related.admin import VerifyRelated @register(YouModel) class YouModelAdmin(VerifyRelated): """ from best performance use `verify_related_fields` because this check all fields is a point to other model and `verify_related_fields` is a direct way. """ verify_related_fields = ('field', 'field2', ...)
Metadata
Release files for django-admin-related 0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-admin-related-0.2.tar.gz | 6.0 kB | Without provenance | Details for django-admin-related-0.2.tar.gz |
Security for django-admin-related 0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.