Package pyperry :: Package middlewares :: Module local_cache :: Class LocalCache
[frames] | no frames]

Class LocalCache

source code

object --+
         |
        LocalCache

LocalCache middleware

Caches results of queries in memory returning the previous result of repeated queries until the entry expires. Entries are cached based on the query used.

Config options:

Importing this module adds the fresh query option to Relation. This allows the developer to easily force a query to be fresh:

   # This query will always fetch fresh data
   Person.where({ 'name': 'bob' }).fresh()
Instance Methods
 
__init__(self, next, options=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
__call__(self, **kwargs) source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables
  cache_store = CacheStore(300)
Properties

Inherited from object: __class__

Method Details

__init__(self, next, options=None)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)