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

Public Member Functions

def lookup (self, obj)
 
- Public Member Functions inherited from _DictAccessorProperty
def __init__ (self, name, default=None, load_func=None, dump_func=None, read_only=None, doc=None)
 
def __get__ (self, obj, type=None)
 
def __set__ (self, obj, value)
 
def __delete__ (self, obj)
 
def __repr__ (self)
 

Static Public Attributes

 read_only
 
- Static Public Attributes inherited from _DictAccessorProperty
 read_only
 

Additional Inherited Members

- Data Fields inherited from _DictAccessorProperty
 name
 
 default
 
 load_func
 
 dump_func
 

Detailed Description

Maps request attributes to environment variables. This works not only
for the Werzeug request object, but also any other class with an
environ attribute:

>>> class Test(object):
...     environ = {'key': 'value'}
...     test = environ_property('key')
>>> var = Test()
>>> var.test
'value'

If you pass it a second value it's used as default if the key does not
exist, the third one can be a converter that takes a value and converts
it.  If it raises :exc:`ValueError` or :exc:`TypeError` the default value
is used. If no default value is provided `None` is used.

Per default the property is read only.  You have to explicitly enable it
by passing ``read_only=False`` to the constructor.

Member Function Documentation

◆ lookup()

def lookup (   self,
  obj 
)

Field Documentation

◆ read_only

read_only
static

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