def get_queryset(self): query_term = i18n_lower(self.request.GET.get("search_term", "")).strip() or None return ( Conversation.objects.list_for_user(self.request.user, query_term) .select_related("target") .prefetch_related(Prefetch("messages", queryset=Message.objects.select_related("recipient"))) )
def _format_title(title): return i18n_lower(title).strip()
def save(self, *args, **kwargs): self.title = i18n_lower(self.title) self.slug = uuslug(self.title, instance=self) super().save(*args, **kwargs)