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

Public Member Functions

def __init__ (self, values=(), on_update=None)
 
def to_header (self)
 
def __str__ (self)
 
def __repr__ (self)
 
- Public Member Functions inherited from UpdateDictMixin
def calls_update (name)
 
def setdefault (self, key, default=None)
 
def pop (self, key, default=_missing)
 

Data Fields

 on_update
 
 provided
 

Static Public Attributes

 no_cache
 
 no_store
 
 max_age
 
 no_transform
 
- Static Public Attributes inherited from UpdateDictMixin
 on_update
 
 clear
 
 popitem
 
 update
 

Detailed Description

Subclass of a dict that stores values for a Cache-Control header.  It
has accessors for all the cache-control directives specified in RFC 2616.
The class does not differentiate between request and response directives.

Because the cache-control directives in the HTTP header use dashes the
python descriptors use underscores for that.

To get a header of the :class:`CacheControl` object again you can convert
the object into a string or call the :meth:`to_header` method.  If you plan
to subclass it and add your own items have a look at the sourcecode for
that class.

.. versionchanged:: 0.4

   Setting `no_cache` or `private` to boolean `True` will set the implicit
   none-value which is ``*``:

   >>> cc = ResponseCacheControl()
   >>> cc.no_cache = True
   >>> cc
   <ResponseCacheControl 'no-cache'>
   >>> cc.no_cache
   '*'
   >>> cc.no_cache = None
   >>> cc
   <ResponseCacheControl ''>

   In versions before 0.5 the behavior documented here affected the now
   no longer existing `CacheControl` class.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  values = (),
  on_update = None 
)

Member Function Documentation

◆ __repr__()

def __repr__ (   self)

◆ __str__()

def __str__ (   self)

◆ to_header()

def to_header (   self)
Convert the stored values into a cache control header.

Field Documentation

◆ max_age

max_age
static

◆ no_cache

no_cache
static

◆ no_store

no_store
static

◆ no_transform

no_transform
static

◆ on_update

on_update

◆ provided

provided

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