How to create a custom admin panel for many models

24 views
Skip to first unread message

9dev...@gmail.com

unread,
Jul 4, 2014, 8:35:03 AM7/4/14
to django...@googlegroups.com

I want to create a custom ModelAdmin, but for a mix of models, not just one.

I have two example models:

class Article(models.Model):
    author = models.GenericIPAddressField()
    # ...

class Comment(models.Model):
    author = models.GenericIPAddressField()
    # ...

Now I want to be able to have a ModelAdmin with fields:

author
number_of_comments
number_of_articles

How can I achieve it?

I created a new ModelAdmin with overridden queryset method, but I was not able to register it, because Article and Comment are already registered.

Reply all
Reply to author
Forward
0 new messages