示例#1
0
 def save(self, **kwargs):
     # generate unique slug
     if hasattr(
             self, 'slug'
     ) and self.id is None and self.slug is None or self.slug == "":
         unique_slugify(self, self.title)
     elif self.id is not None and self.slug:
         unique_slugify(self, self.slug)
     super(Taxonomy, self).save(**kwargs)
示例#2
0
 def save(self, **kwargs):
     # generate unique slug
     if hasattr(self, 'slug'):
         unique_slugify(self, self.title)
     super(Taxonomy, self).save(**kwargs)
示例#3
0
 def save(self, **kwargs):
     # generate unique slug
     unique_slugify(self, slug_field_name='label', value=self.name)
     super(Destination, self).save(**kwargs)
示例#4
0
 def save(self, **kwargs):
     # generate unique slug
     if hasattr(self, 'slug') and self.slug is None or self.slug == '':
         unique_slugify(self, self.title)
     super(Board, self).save(**kwargs)
示例#5
0
 def save(self, **kwargs):
     slug = u"{0}".format(self.name.lower())
     unique_slugify(self, slug)
     super(Keyword, self).save()
示例#6
0
文件: models.py 项目: Frky/wis
 def save(self, *args, **kwargs):
     if self.title:
         unique_slugify(self, self.title[:255], slug_field_name='slug_name')
     super(Gallery, self).save(*args, **kwargs)