V
V
Vic Shostak2018-02-02 13:37:48
Django
Vic Shostak, 2018-02-02 13:37:48

django admin. Is it possible to display a general list consisting of different models in the standard admin panel?

Greetings!
Question: is it possible to display a general list consisting of different models in the standard admin panel? I'm using Django 2.x.
Here is the application structure:

# app_one/models.py

class AppOne(models.Model):
    number = models.IntegerField(_('Number'), default=0)
    ...

# app_two/models.py

class AppTwo(models.Model):
    name = models.CharField(_('Name'), max_length=255)
    ...

# app_three/models.py

class AppThree(models.Model):
    is_ready = models.BooleanField(_('Is ready?'), default=False)
    ...

What is it for? Let me explain. For example, each application is used to collect user data from the front (questionnaires with surveys, all fields, except for some, are different - therefore, most likely, it was separated into separate models).

With the classic approach, when registering these models in the Dzhangi admin panel, they will each be on a separate sub-page. So, it would be very cool to have a list of all these models on one page - especially for site moderators (no need to jump through different pages, everything flies to one place).
So far, thoughts about redefining the admin template for one of the models and hardcode the formation of a QuerySet for it .. but I would not really like it, maybe there is a more correct way or is there a ready-made package for this?
I will be glad to sensible comments. Thank you!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question