#37153: Store the cache alias on the cache backend instance
-------------------------------------+-------------------------------------
     Reporter:  Tim Schilling        |                     Type:  New
                                     |  feature
       Status:  new                  |                Component:  Core
                                     |  (Cache system)
      Version:  dev                  |                 Severity:  Normal
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  1                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
 Store the alias used to fetch a cache backend instance on the instance
 itself. The Django Debug Toolbar is having to do some extra patching
 (django-commons/django-debug-toolbar#2219) to retain what alias is being
 used for which cache. While tolerable, it means the toolbar is having to
 reimplement more parts of Django, making it more brittle for future
 versions.

 django/new-features: https://github.com/django/new-features/issues/95

 Ideal code:

 {{{
 from django.core.cache import cache

 print(cache.alias)
 # "default"
 }}}

 I believe we need to make the following changes:
 - Update CacheHandler.create_connection to pass alias as
 backend_cls(location, params, alias=alias)
 - Update django.core.cache.backends.base.BaseCache.__init__ to accept and
 store alias
-- 
Ticket URL: <https://code.djangoproject.com/ticket/37153>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-updates/0107019eae197639-7a6c2c1b-12d8-4cab-a700-32f25d70f45d-000000%40eu-central-1.amazonses.com.

Reply via email to