def is_valid_slug(allow_slash=True):
  def validator(form, value):
    if len(value) > 200:
      raise ValidationError(_(u'The slug is too long'))
    elif value.startswith('/'):
      raise ValidationError(_(u'The slug must not start with a slash'))
  return validator
Check if the value given is a valid slug:
dataset/ETHPy150Open IanLewis/kay/kay/utils/validators.py/is_valid_slug