Opened 15 years ago
Last modified 15 years ago
#15337 closed
cyclic import dependency when extend builtin backend — at Initial Version
| Reported by: | Owned by: | nobody | |
|---|---|---|---|
| Component: | Core (Cache system) | Version: | 1.3-beta |
| Severity: | Keywords: | ||
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
When writing a custom cache backend which inherit from django's builtin memcache backend, say mycache.py:
from django.core.cache.backends.memcached import CacheClass as BaseCacheClass
class MyCache(BaseCacheClass):
....
and set backend to "mycache.MyCache" in settings.py, then mycache.py and django.core.cache.init.py import each other.
Turn django.core.cache.init.py::cache object to be a SimpleLazyObject would solve this problem.
Note:
See TracTickets
for help on using tickets.