Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(1)  |  Call(0)  |  Derive(0)  |  Import(1)
validates that the value is a valid variable name

* lower case, a-z, 0-9, _
* no spaces, no dashes or any other special characters

        def variable_name_validator(value):
    """
    validates that the value is a valid variable name

    * lower case, a-z, 0-9, _
    * no spaces, no dashes or any other special characters
    """
    if not VARIABLE_REGEX_COMPILED.search(value):
        raise ValidationError('allowed characters: %s' % VARIABLE_ALLOWED_CHARS)
        


src/d/p/dploi-server-HEAD/dploi_server/models.py   dploi-server(Download)
#-*- coding: utf-8 -*-
import random
from django.db import models
from dploi_server.utils.password import generate_password
from dploi_server.validation import variable_name_validator, variable_name_and_dash_validator