Exemplo n.º 1
0
 def get_absolute_url(self, board=None):
     kwargs = {"conversation": self, "slug": self.slug}
     if board is None:
         board = getattr(self, "board", None)
     if board:
         kwargs["board"] = board
         return SafeUrl("boards:conversation-detail", **kwargs)
     else:
         return SafeUrl("conversation:detail", **kwargs)
Exemplo n.º 2
0
    def url(self, which, board=None, **kwargs):
        """
        Return a url pertaining to the current conversation.
        """
        if board is None:
            board = getattr(self, "board", None)

        kwargs["conversation"] = self
        kwargs["slug"] = self.slug

        if board:
            kwargs["board"] = board
            which = "boards:" + which.replace(":", "-")
            return SafeUrl(which, **kwargs)

        return SafeUrl(which, **kwargs)
Exemplo n.º 3
0
 def url(self, which, **kwargs):
     kwargs["board"] = self
     return SafeUrl(which, **kwargs)