コード例 #1
0
ファイル: models.py プロジェクト: kylewm/redwind
 def format_context(ctx):
     if ctx.title and ctx.author_name:
         return '“{}” by {}'.format(ctx.title, ctx.author_name)
     if ctx.title:
         return ctx.title
     if ctx.author_name:
         return 'a post by {}'.format(ctx.author_name)
     return util.prettify_url(ctx.permalink)
コード例 #2
0
ファイル: models.py プロジェクト: TylerMorley/redwind
 def format_context(ctx):
     if ctx.title and ctx.author_name:
         return '“{}” by {}'.format(ctx.title, ctx.author_name)
     if ctx.title:
         return ctx.title
     if ctx.author_name:
         return 'a post by {}'.format(ctx.author_name)
     return util.prettify_url(ctx.permalink)
コード例 #3
0
ファイル: models.py プロジェクト: kylewm/redwind
    def get_slugify_target(self):
        components = []
        if self.author_name:
            components.append(self.author_name)

        if self.title:
            components.append(self.title)
        elif self.content_plain:
            components.append(self.content_plain)
        else:
            components.append(util.prettify_url(self.permalink or self.url))

        return ' '.join(components)
コード例 #4
0
ファイル: models.py プロジェクト: TylerMorley/redwind
    def get_slugify_target(self):
        components = []
        if self.author_name:
            components.append(self.author_name)

        if self.title:
            components.append(self.title)
        elif self.content_plain:
            components.append(self.content_plain)
        else:
            components.append(util.prettify_url(self.permalink or self.url))

        return ' '.join(components)
コード例 #5
0
ファイル: models.py プロジェクト: kylewm/redwind
 def title_or_url(self):
     return self.title or util.prettify_url(self.permalink)
コード例 #6
0
ファイル: models.py プロジェクト: TylerMorley/redwind
 def title_or_url(self):
     return self.title or util.prettify_url(self.permalink)
コード例 #7
0
ファイル: views.py プロジェクト: mongolsamurai/redwind
def prettify_url(*args, **kwargs):
    return util.prettify_url(*args, **kwargs)
コード例 #8
0
def prettify_url(*args, **kwargs):
    return util.prettify_url(*args, **kwargs)