Lets say i have a model A. Then, i have several models B, C, D, E etc that each have a foreignKey to model A. I know that i can set B, C, D etc as inlines to model A so that when i create a model A it will show formsets for adding multiple items for each subModel, but i think this would make a fairly cluttered and very large page.
Is there a way to somehow, instead of having all of these formsets inline on the same page, to have each formset on a separate page? in other words, there would be links from model A to create/edit associate model B's, create/edit associated model C's, etc?
Thanks!
To login to the site, open the /admin URL (e.g. http://127.0.0.1:8000/admin ) and enter your new superuser userid and password credentials (you'll be redirected to the login page, and then back to the /admin URL after you've entered your details).
django-inline-actions provides a handy templatetag render_inline_action_fields , which adds these information as hidden fields to a form. As the action does not know that an intermediate form is used, we have to include some special handling.
your company should follow a least access principle policy; so yes: only select people should have access. Django has basic auditing capability via signals and displayed in the admin out of the box. You can build on top of this.
You can add another class called Meta in your model to specify plural display name. For example, if the model's name is Category , the admin displays Categorys , but by adding the Meta class, we can change it to Categories . Literally saved my life!
I’m looking for a way to do exactly the same thing. It looks like the answer might be 'proxy models'. It's suggested as an answer to this Stack Overflow query:
django admin: separate read-only view and change view
…and this query asking about multiple admin lists for the same model:
Multiple ModelAdmins/views for same model in Django admin
Documentation on Proxy Models here:
Django | Models | Django documentation#Proxy models
I’m a newcomer to Django myself, so will post a more complete reply once I get it to work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With