rafalp/Misago

Replace thread queryset plugin hooks used by thread detail view and private thread detail views

Geschlossen

#2.078 geöffnet am 17.05.2026

 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Python (555 Forks)batch import
area: backendfeature: extensionsfeature: thread pagehelp wanted

Repository-Metriken

Stars
 (2.775 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 2T 6h) (37 gemergte PRs in 30 T)

Beschreibung

Those functions no longer exist on thread detail views:

  • get_thread_queryset
  • get_private_thread_queryset

Instead, we should implement get_thread_detail_view_select_related and get_private_thread_detail_view_select_related hooks that will take HttpRequest as only argument and return list[str].

DetailView should be updated to implement get_thread_select_related method:

def get_thread_select_related(self, request: HttpRequest) -> list[str]:
    return ["category"]

In ThreadDetailView:

def get_thread_select_related(self, request: HttpRequest) -> list[str]:
    return get_thread_detail_view_select_related_hook(super().get_thread_select_related, request)

In PrivateThreadDetailView:

def get_thread_select_related(self, request: HttpRequest) -> list[str]:
    return get_private_thread_detail_view_select_related_hook(super().get_thread_select_related, request)

get_thread calls in those detail views should be updated to self.get_thread(..., select_Related=self.get_thread_select_related(request))

Contributor Guide