예제 #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
 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
    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
 def title_or_url(self):
     return self.title or util.prettify_url(self.permalink)
예제 #7
0
def prettify_url(*args, **kwargs):
    return util.prettify_url(*args, **kwargs)
예제 #8
0
def prettify_url(*args, **kwargs):
    return util.prettify_url(*args, **kwargs)