Exemplo n.º 1
0
    def publish_banner_image(self):
        """
        This method get's utilised by Publisa to get the banner image.

        In artikelly we have chosen to look for photo inlines and return the
        first found photo as a banner image.

        """
        inline_list = inlines(self.teaser, return_list=True)
        inline_list += inlines(self.body, return_list=True)
        if inline_list:
            for item in inline_list:
                if item.__class__.__name__ == 'Photo':
                    return item.photo
            return None
        else: return None
Exemplo n.º 2
0
 def save(self, force_insert=False, force_update=False):
     """ Override the save method to parse the markdown in HTML """
     self.teaser_html = inlines(self.teaser)
     self.body_html = inlines(self.body)
     super(Article, self).save(force_insert, force_update)