Exemplo n.º 1
0
  def create_slug(self, diary_id):
    self.slug = utils.slugify(self.title)

    counter = 0
    new = self.slug
    while self.query.filter(Post.slug == new, Post.diary_id == diary_id).first() is not None:
      counter += 1
      new = "{0}-{1}".format(self.slug, counter)
    self.slug = new
Exemplo n.º 2
0
  def create_slug(self):
    self.slug = utils.slugify(self.title)

    counter = 0
    new = self.slug
    while self.query.filter(Diary.slug == new).first() is not None:
      counter += 1
      new = "{0}-{1}".format(self.slug, counter)
    self.slug = new
Exemplo n.º 3
0
  def create_slug(self, diary_id):
    self.slug = utils.slugify(self.title)

    counter = 0
    new = self.slug
    while self.query.filter(Post.slug == new, Post.diary_id == diary_id).first() is not None:
      counter += 1
      new = "{0}-{1}".format(self.slug, counter)
    self.slug = new
Exemplo n.º 4
0
  def create_slug(self):
    self.slug = utils.slugify(self.title)

    counter = 0
    new = self.slug
    while self.query.filter(Diary.slug == new).first() is not None:
      counter += 1
      new = "{0}-{1}".format(self.slug, counter)
    self.slug = new
Exemplo n.º 5
0
 def __init__(self, title):
   self.title = title
   self.slug = utils.slugify(title)
Exemplo n.º 6
0
 def __init__(self, title):
   self.title = title
   self.slug = utils.slugify(title)