예제 #1
0
    def save(self, *args, **kwargs):
        if not self.slug:
            from turbion.bits.utils.text import slugify
            self.slug = slugify(self.title)

        self.edited_on = datetime.now()

        super(Post, self).save(*args, **kwargs)
예제 #2
0
    def _get_val_from_obj(self, obj):
        from turbion.bits.utils.text import slugify

        if obj:
            val = getattr(obj, self.attname, None)
            if not val:
                val = slugify("".join([getattr(obj, name) for name in self.prepopulate_from if hasattr(obj, name)]))
            return val
        return self.get_default()
예제 #3
0
    def save(self, *args, **kwargs):
        if not self.slug:
            from turbion.bits.utils.text import slugify
            self.slug = slugify(self.name)

        super(Tag, self).save(*args, **kwargs)