예제 #1
0
 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")))
     )
예제 #2
0
 def _format_title(title):
     return i18n_lower(title).strip()
예제 #3
0
 def save(self, *args, **kwargs):
     self.title = i18n_lower(self.title)
     self.slug = uuslug(self.title, instance=self)
     super().save(*args, **kwargs)