[Python] How to implement thumbnail images into Wagtail’s ModelViewSet?

Discussão em 'Python' iniciado por Stack, Janeiro 15, 2025.

  1. Stack

    Stack Membro Participativo

    Is it still possible to implement a thumbnail image in a ModelViewSet listing view? Here is an example for a NewsPost model.

    class NewsPostViewSet(ModelViewSet):
    model = NewsPost
    list_display = ["title", "category", "date_start", "date_end", "live"]
    add_to_admin_menu = True
    icon = "calendar-alt"
    menu_label = "News"


    The PageListingViewSet has columns with all kinds of columns for different model types. But also no "ImageColumn" to display a thumbnail image. I miss the ThumbnailMixin that the Wagtail ModelAdmin app provided, which is now deprecated. Does anybody know a workaround?

    Continue reading...

Compartilhe esta Página