Ejemplo n.º 1
0
    def save(self, *args, **kwargs):

        if hasattr(self, 'content') and self.content.strip():

            self.content = helpers.contentreplace(self.content, out=False)

        super(Content, self).save(*args, **kwargs)
Ejemplo n.º 2
0
    def save(self, *args, **kwargs):

        if not self.image and not self.is_machine:
            self.image = settings.DEF_IMAGE

        if not self.slug:
            # 根据作者和标题生成文章在URL中的别名
            self.slug = slugify(self.name)

        if hasattr(self, 'info') and self.info.strip():
            self.info = helpers.contentreplace(self.info, out=False)

        super(Album, self).save(*args, **kwargs)
Ejemplo n.º 3
0
 def get_content(self):
     return helpers.contentreplace(self.content, out=True)
Ejemplo n.º 4
0
 def get_info(self):
     return helpers.contentreplace(self.info, out=True)