﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
13835	enhancements in django.db.models to get info about additional tables	fetzig	nobody	"hi,

would like to see this patch in django. why? i'm trying to explain...without being to verbose...

i'm using django-johnny-cache (automatically caches results of querysets).

the concept is pretty simple (still more simplified):
 * create cache key: table name + md5 hash of the db query (and its params).
 * get/set cache works without any additional configuration in the code.
 * update/insert/delete: invalidate all keys relating to this table (problem is: there is more than one table...)

when creating select statements which aggregate data of multiple tables the cache is not working correctly. => it doesn't invalidate all invalid cache keys. => you get old data :(

there is a fix for that, but it includes patching django

please have a look at this patch (attached). its totally backward compatible. just adds a table variable/property on some places. it looks ok for me...

link to johnny-cache issue http://bitbucket.org/jmoiron/johnny-cache/issue/7/use-subselect-tables-in-query-cache-key

thanks for feedback.
feel free to ask for more info.

kthxby,
klemens"		closed	Database layer (models, ORM)	1.2		wontfix	cache, johnny-cache		Accepted	1	0	0	0	0	0
