OpenQuizz
Une application de gestion des contenus pédagogiques
URL Class Reference
Inheritance diagram for URL:
Collaboration diagram for URL:

Public Member Functions

def __init__ (self, check=False, ip=False, local=False, port=False, auth=False, schemes=None, domains=None, exclude=None)
 
def error (self, value, details=None)
 
def __call__ (self, value)
 
def __schema__ (self)
 

Data Fields

 check
 
 ip
 
 local
 
 port
 
 auth
 
 schemes
 
 domains
 
 exclude
 

Detailed Description

Validate an URL.

Example::

    parser = reqparse.RequestParser()
    parser.add_argument('url', type=inputs.URL(schemes=['http', 'https']))

Input to the ``URL`` argument will be rejected
if it does not match an URL with specified constraints.
If ``check`` is True it will also be rejected if the domain does not exists.

:param bool check: Check the domain exists (perform a DNS resolution)
:param bool ip: Allow IP (both ipv4/ipv6) as domain
:param bool local: Allow localhost (both string or ip) as domain
:param bool port: Allow a port to be present
:param bool auth: Allow authentication to be present
:param list|tuple schemes: Restrict valid schemes to this list
:param list|tuple domains: Restrict valid domains to this list
:param list|tuple exclude: Exclude some domains

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  check = False,
  ip = False,
  local = False,
  port = False,
  auth = False,
  schemes = None,
  domains = None,
  exclude = None 
)

Member Function Documentation

◆ __call__()

def __call__ (   self,
  value 
)

◆ __schema__()

def __schema__ (   self)

◆ error()

def error (   self,
  value,
  details = None 
)

Field Documentation

◆ auth

auth

◆ check

check

◆ domains

domains

◆ exclude

exclude

◆ ip

ip

◆ local

local

◆ port

port

◆ schemes

schemes

The documentation for this class was generated from the following file: