Skip to main content

Non-magical object caching for Django.

Project description

django-cache-toolbox

Non-magical object caching for Django.

Another caching framework for Django that does not do any magic behind your back, saving brain cycles when debugging as well as sticking to Django principles.

Installation

From PyPI:

pip install django-cache-toolbox

Basic Usage

from cache_toolbox import cache_model, cache_relation
from django.db import models

class Foo(models.Model):
    ...

class Bazz(models.Model):
    foo = models.OneToOneField(Foo, related_name='bazz', primary_key=True)
    ...

# Prepare caching of a model
cache_model(Foo)

# Prepare caching of a relation
cache_relation(Foo.bazz)

# Fetch the cached version of a model
foo = Foo.get_cached(pk=42)

# Load a cached relation
print(foo.bazz_cache)

See the module docstrings for further details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-cache-toolbox-1.6.1.tar.gz (10.0 kB view hashes)

Uploaded Source

Built Distribution

django_cache_toolbox-1.6.1-py2.py3-none-any.whl (11.8 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page