Ejemplo n.º 1
0
def request_cache(expiry=DEFAULT_EXPIRY):
    """
    A decorator that can be used on a method of a GenericReportView subclass

    or any other class that provides the following properties:
      - self.request (a django request object, with .domain and .couch_user)
      - self.is_cacheable (boolean)

    """

    return quickcache(vary_on=_custom_vary_on, timeout=expiry, helper_class=_ReportQuickCache)
Ejemplo n.º 2
0
def request_cache(expiry=DEFAULT_EXPIRY):
    """
    A decorator that can be used on a method of a GenericReportView subclass

    or any other class that provides the following properties:
      - self.request (a django request object, with .domain and .couch_user)
      - self.is_cacheable (boolean)

    """

    return quickcache(vary_on=_custom_vary_on,
                      timeout=expiry, helper_class=_ReportQuickCacheHelper)