From 2d7b06c956e04f5a1aee68269c6201499a1ec5a3 Mon Sep 17 00:00:00 2001 From: Mike <22396211+Dresdn@users.noreply.github.com> Date: Wed, 6 Mar 2024 09:40:34 -0700 Subject: [PATCH] docs(eav): update documentation for Django EAV 2 admin integration and settings --- CHANGELOG.md | 3 +++ docs/source/conf.py | 1 + docs/source/usage.rst | 14 ++++++++++++-- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index af89f8e7..5d61a140 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ We follow [Semantic Versions](https://semver.org/) starting at the `0.14.0` rele ## {{ Next Version }} ### Bug Fixes + +- Corrects `BaseEntityAdmin` integration into Django Admin site + ### Features ## 1.5.0 (2023-11-08) diff --git a/docs/source/conf.py b/docs/source/conf.py index 3547157a..811ce9d4 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -26,6 +26,7 @@ 'eav', ], SECRET_KEY=os.environ.get('DJANGO_SECRET_KEY', 'this-is-not-s3cur3'), + EAV2_PRIMARY_KEY_FIELD="django.db.models.BigAutoField", ) # Call django.setup to load installed apps and other stuff. diff --git a/docs/source/usage.rst b/docs/source/usage.rst index 83381494..b1e9bb19 100644 --- a/docs/source/usage.rst +++ b/docs/source/usage.rst @@ -286,8 +286,10 @@ You can use ``Q`` expressions too: Admin Integration ----------------- -Django EAV 2 includes integration for Django's admin. As usual, you need to -register your model first: +Django EAV 2 seamlessly integrates with Django's admin interface by providing +dynamic attribute management directly within the admin panel. This feature +provides the EAV Attributes as a separate fieldset, whether use the base +fieldset or when providing your own. .. code-block:: python @@ -302,3 +304,11 @@ register your model first: form = PatientAdminForm admin.site.register(Patient, PatientAdmin) + +Customizing the EAV Fieldset +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The Django EAV 2 integration allows you to customize the presentation of EAV +attributes in the admin interface through the use of a dedicated fieldset. You +can configure this fieldset by setting ``eav_fieldset_title`` and +``eav_fieldset_description`` within your admin class.