Skip to content

Commit

Permalink
Update README.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
cuongnb14 authored Feb 23, 2023
1 parent 3cfdfb1 commit 33fa8a2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,21 @@ Add bookmark

.. image:: screenshots/demo-bookmark.png?raw=true

Automatically Register All Models In Django Admin
----
Add this code at **end of admin.py file** of **lastest install app (INSTALLED_APPS setting)**

.. code:: python
from admin_extended.utils import auto_register_model_admin
auto_register_model_admin()
**auto_register_model_admin(default_model_admin_class=DefaultModelAdmin, ignore_models=[]):**
This function will automatic register admin for all unregistered model

- default_model_admin_class: DefaultModelAdmin will list all fields of model in change list page, you can custom your model admin and pass to this param
- ignore_models: list model you don't want auto register. specify by <app_label>.<model_name>. Eg: 'users.user'


Screenshots
Expand Down

0 comments on commit 33fa8a2

Please sign in to comment.