Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying old version #492

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions cacheops/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
__version__ = '7.1'
VERSION = tuple(map(int, __version__.split('.')))

from django.apps import AppConfig
from .simple import * # noqa
from .query import * # noqa
from .invalidation import * # noqa
from .reaper import * # noqa
from .templatetags.cacheops import * # noqa
from .transaction import * # noqa

class CacheopsConfig(AppConfig):
name = 'cacheops'

def ready(self):
install_cacheops()
install_cacheops_transaction_support()

default_app_config = 'cacheops.CacheopsConfig'
9 changes: 6 additions & 3 deletions cacheops/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@

from django.utils.encoding import force_str
from django.core.exceptions import ImproperlyConfigured, EmptyResultSet
from django.db import DEFAULT_DB_ALIAS, connections, models
from django.db import DEFAULT_DB_ALIAS, models
from django.db.models.manager import BaseManager
from django.db.models.query import MAX_GET_RESULTS
try:
from django.db.models.query import MAX_GET_RESULTS
from django.db import connections
except ImportError:
MAX_GET_RESULTS = None
from django.db.models.signals import pre_save, post_save, post_delete, m2m_changed
from django.db.transaction import atomic

Expand All @@ -28,7 +32,6 @@

_local_get_cache = {}


def cached_as(*samples, timeout=None, extra=None, lock=None, keep_fresh=False):
"""
Caches results of a function and invalidates them same way as given queryset(s).
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
],
python_requires='>=3.7',
install_requires=[
'django>=3.2',
'django>=2.0',
'redis>=3.0.0',
'funcy>=1.8',
],
Expand Down