|
2 | 2 | import hashlib
|
3 | 3 | import logging
|
4 | 4 | import time
|
5 |
| -import warnings |
6 | 5 |
|
7 | 6 | from django.conf import settings
|
8 | 7 | from django.core.cache import DEFAULT_CACHE_ALIAS, caches
|
9 | 8 | from django.db.models import Model as DjangoModel
|
10 |
| -from django.utils.deprecation import RenameMethodsBase |
11 | 9 | from django.utils.itercompat import is_iterable
|
12 | 10 |
|
13 |
| -from .utils import RemovedInCacheback13Warning, enqueue_task, get_job_class |
| 11 | +from .utils import enqueue_task, get_job_class |
14 | 12 |
|
15 | 13 |
|
16 | 14 | logger = logging.getLogger('cacheback')
|
@@ -39,16 +37,7 @@ def to_bytestring(value):
|
39 | 37 | return bytes(str(value), 'utf8')
|
40 | 38 |
|
41 | 39 |
|
42 |
| -class JobBase(RenameMethodsBase): |
43 |
| - |
44 |
| - renamed_methods = ( |
45 |
| - ('get_constructor_args', 'get_init_args', RemovedInCacheback13Warning), |
46 |
| - ('get_constructor_kwargs', 'get_init_kwargs', RemovedInCacheback13Warning), |
47 |
| - ('cache_set', 'store', RemovedInCacheback13Warning), |
48 |
| - ) |
49 |
| - |
50 |
| - |
51 |
| -class Job(metaclass=JobBase): |
| 40 | +class Job(object): |
52 | 41 | """
|
53 | 42 | A cached read job.
|
54 | 43 |
|
@@ -387,17 +376,6 @@ def should_missing_item_be_fetched_synchronously(self, *args, **kwargs):
|
387 | 376 | """
|
388 | 377 | return self.fetch_on_miss
|
389 | 378 |
|
390 |
| - def should_item_be_fetched_synchronously(self, *args, **kwargs): |
391 |
| - import warnings |
392 |
| - |
393 |
| - warnings.warn( |
394 |
| - "The method 'should_item_be_fetched_synchronously' is deprecated " |
395 |
| - "and will be removed in 0.5. Use " |
396 |
| - "'should_missing_item_be_fetched_synchronously' instead.", |
397 |
| - DeprecationWarning, |
398 |
| - ) |
399 |
| - return self.should_missing_item_be_fetched_synchronously(*args, **kwargs) |
400 |
| - |
401 | 379 | def should_stale_item_be_fetched_synchronously(self, delta, *args, **kwargs):
|
402 | 380 | """
|
403 | 381 | Return whether to refresh an item synchronously when it is found in the
|
@@ -471,14 +449,6 @@ def process_result(self, result, call, cache_status, sync_fetch=None):
|
471 | 449 | # ASYNC HELPER METHODS
|
472 | 450 | # --------------------
|
473 | 451 |
|
474 |
| - @classmethod |
475 |
| - def job_refresh(cls, *args, **kwargs): |
476 |
| - warnings.warn( |
477 |
| - '`Job.job_refresh` is deprecated, use `perform_async_refresh` instead.', |
478 |
| - RemovedInCacheback13Warning, |
479 |
| - ) |
480 |
| - return cls.perform_async_refresh(*args, **kwargs) |
481 |
| - |
482 | 452 | @classmethod
|
483 | 453 | def perform_async_refresh(cls, klass_str, obj_args, obj_kwargs, call_args, call_kwargs):
|
484 | 454 | """
|
|
0 commit comments