code: def generate_slug(name):
          
          slug = slugify(name)
  
          i = KnwKB.query.filter(db.or_(
              KnwKB.slug.like(slug),
              KnwKB.slug.like(slug + '-%'),
          )).count()
  
          return slug + ('-{0}'.format(i) if i > 0 else '')
docs: Generate a slug for the knowledge.
  
          :param name: text to slugify
          :return: slugified text