Opened 5 years ago

Closed 3 years ago

#15888 closed Cleanup/optimization (fixed)

Inspect `settings.CACHES` in order to make`createcachetable` automatic

Reported by: Aymeric Augustin Owned by: nobody
Component: Core (Cache system) Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Currently createcachetable requires the cache table name in argument. This information could be taken from the settings instead.

See http://code.djangoproject.com/ticket/15255#comment:2 for a more complete description of the idea.

Attachments (2)

15888-docs.patch (4.4 KB) - added by Aymeric Augustin 5 years ago.
15888-code-1.diff (8.1 KB) - added by Claude Paroz 4 years ago.
Tentative code implementation

Download all attachments as: .zip

Change History (11)

comment:1 Changed 5 years ago by Aymeric Augustin

Needs documentation: unset
Needs tests: unset
Owner: changed from nobody to Aymeric Augustin
Patch needs improvement: unset
Triage Stage: UnreviewedAccepted

Since jacob supported this idea (see http://code.djangoproject.com/ticket/15255#comment:4), I'm marking it as accepted.

comment:2 Changed 5 years ago by Aymeric Augustin

Here is a proposed patch for the docs. I'll wait until #15255 gets committed before working on a patch for the code — both tickets touch the same piece of code and the patches would conflict.

Changed 5 years ago by Aymeric Augustin

Attachment: 15888-docs.patch added

comment:3 Changed 5 years ago by Jannis Leidel

UI/UX: unset

FYI, #15255 was committed.

comment:4 Changed 5 years ago by Aymeric Augustin

Owner: changed from Aymeric Augustin to nobody

Changed 4 years ago by Claude Paroz

Attachment: 15888-code-1.diff added

Tentative code implementation

comment:5 Changed 4 years ago by Claude Paroz

I've just attached an initial implementation. Tests should probably be still completed.
The question is now: do we want to keep the legacy behaviour of specifying one or more table names as arguments, or do we want to deprecate this?

comment:6 Changed 3 years ago by Claude Paroz

Has patch: set
Version: 1.3master

Patch updated to current trunk and PR created: https://github.com/django/django/pull/1727

comment:7 Changed 3 years ago by Aymeric Augustin

Patch needs improvement: set

Tim suggested some improvements on the pull request.

comment:8 Changed 3 years ago by Tim Graham

Patch needs improvement: unset
Triage Stage: AcceptedReady for checkin

comment:9 Changed 3 years ago by Claude Paroz <claude@…>

Resolution: fixed
Status: newclosed

In 1e8eadc94e3b27fe90ce9356b48e8543a1ff590e:

Fixed #15888 -- Made tablename argument of createcachetable optional

Thanks Aymeric Augustin for the report and the documentation and
Tim Graham for the review.

Note: See TracTickets for help on using tickets.
Back to Top