djangowagtaildjango-comments

django-fluent-comments model doesn't appear in Wagtail ModelAdmin


I have a Wagtail project that uses django-fluent-comments and I would like to be able moderate the comments in the admin pages. Based on this tutorial I added this to my wagtail_hooks.py file:

class CommentAdmin(ModelAdmin):
    model = FluentComment

    menu_label = 'Comments'
    menu_icon = 'list-ul'
    menu_order = 200
    add_to_settings_menu = False
    list_display = ('user', 'comment')

modeladmin_register(CommentAdmin)

But when I go to the Admin pages, there is no comments tab and no errors shown. I have tried to add a Pages model to my Admin page and that worked fine.

The FluentComment model is just:

class FluentComment(Comment):
    """
    Proxy model to make sure that a ``select_related()`` is performed on the ``user`` field.
    """
    objects = FluentCommentManager()

    class Meta:
        proxy = True

(In this file) So I wonder if I have the correct model. But the if I add print model.objects.all() to my CommentAdmin class it shows all my comments in the log.


Solution

  • Change FluentComment to django_comments.models.Comment. FluentComment is Proxy model which wagtail's modeladmin does not like.