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

Public Member Functions

def get (self, name, default=None)
 
def pop (self, name, default=_sentinel)
 
def setdefault (self, name, default=None)
 
def __contains__ (self, item)
 
def __iter__ (self)
 
def __repr__ (self)
 

Detailed Description

A plain object. Used as a namespace for storing data during an
application context.

Creating an app context automatically creates this object, which is
made available as the :data:`g` proxy.

.. describe:: 'key' in g

    Check whether an attribute is present.

    .. versionadded:: 0.10

.. describe:: iter(g)

    Return an iterator over the attribute names.

    .. versionadded:: 0.10

Member Function Documentation

◆ __contains__()

def __contains__ (   self,
  item 
)

◆ __iter__()

def __iter__ (   self)

◆ __repr__()

def __repr__ (   self)

◆ get()

def get (   self,
  name,
  default = None 
)
Get an attribute by name, or a default value. Like
:meth:`dict.get`.

:param name: Name of attribute to get.
:param default: Value to return if the attribute is not present.

.. versionadded:: 0.10

◆ pop()

def pop (   self,
  name,
  default = _sentinel 
)
Get and remove an attribute by name. Like :meth:`dict.pop`.

:param name: Name of attribute to pop.
:param default: Value to return if the attribute is not present,
    instead of raise a ``KeyError``.

.. versionadded:: 0.11

◆ setdefault()

def setdefault (   self,
  name,
  default = None 
)
Get the value of an attribute if it is present, otherwise
set and return a default value. Like :meth:`dict.setdefault`.

:param name: Name of attribute to get.
:param: default: Value to set and return if the attribute is not
    present.

.. versionadded:: 0.11

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