Example #1
0
class PatientCreateSchema(types.Type):
    nom = validators.String(max_length=MAX_LENGTH["nom"])
    prenom = validators.String(max_length=MAX_LENGTH["prenom"])
    ddn = validators.Date()
    sexe = validators.String(description="sexe",
                             max_length=MAX_LENGTH["sexe"],
                             enum=SEXE)
class User(types.Type):
    """Simple User class."""

    userid = validators.Integer(minimum=1, allow_null=True)
    userhash = validators.String(min_length=32, max_length=32)
    username = validators.String(max_length=50)
    fullname = validators.String(max_length=100)
    joined = validators.Date(allow_null=True)
    timezone = validators.String(enum=VALID_TIMEZONES)
class Device(types.Type):
    id = validators.Integer(allow_null=True, minimum=1, maximum=999)
    device_model = validators.String(enum=list(DEVICE_MODELS))
    ip_address = validators.String(default='127.0.0.1')
    remote_access_type = validators.String(
        enum=['ssh', 'telnet', 'http', 'https'], default='ssh')
    login = validators.String(default='cisco')
    password = validators.String(default='cisco', min_length=5)
    secret = validators.String(default='cisco', min_length=5)
    apc = validators.Boolean(default=False)
    free_access_to_site = validators.Boolean(default=True)
    start_date = validators.Date(default=DEFAULT_DATE)
    company_name = validators.String(allow_null=True)
    city = validators.String(allow_null=True)
    city_address = validators.String(allow_null=True)
    owner = validators.String(allow_null=True)
    phone = validators.String(min_length=12, max_length=12)
    email = validators.String(allow_null=True)
Example #4
0
class PatientUpdateSchema(types.Type):
    nom = validators.String(max_length=MAX_LENGTH["nom"], default="")
    prenom = validators.String(max_length=MAX_LENGTH["prenom"], default="")
    ddn = validators.Date(default="")
    sexe = validators.String(enum=SEXE, default=None, allow_null=True)
    rue = validators.String(description="rue",
                            max_length=MAX_LENGTH["rue"],
                            default="")
    cp = validators.Integer(description="Code Postal",
                            default=None,
                            allow_null=True)
    ville = validators.String(description="Ville",
                              max_length=MAX_LENGTH["ville"],
                              default="")
    tel = validators.String(description="Numéro de Téléphone",
                            max_length=MAX_LENGTH["tel"],
                            default="")
    email = validators.String(description="email",
                              max_length=MAX_LENGTH["email"],
                              default="")
    alive = validators.Boolean(description="vivant ?",
                               default=None,
                               allow_null=True)
 class Example(types.Type):
     when = validators.Date(allow_null=True)
 class Example(types.Type):
     when = validators.Date()
Example #7
0
class DaysType(types.Type):
    dayofweek = validators.Integer(minimum=1, maximum=7)
    local_date = validators.Date()
    status = validators.String(enum=['open', 'closed'])
    opening_hours = validators.Array(items=OpeningHoursType)