django-cacheops icon indicating copy to clipboard operation
django-cacheops copied to clipboard

Multi-table inheritance not supported

Open Suor opened this issue 12 years ago • 5 comments

More precisely, automatic event-based doesn't work properly for it. There are actually two different cases:

  1. When SubModel instance is added, changed or deleted none of BaseModel queries invalidated.
  2. When BaseModel instance changed or deleted none of queries for any submodels are invalidated.

Suor avatar Feb 03 '13 14:02 Suor

Postponed multi-table inheritance support. Some champion can implement it - and I'll thankfully merge. I will probably reconsider implementing it if this feature will gain sufficient interest one day.

Suor avatar Feb 04 '13 15:02 Suor

Is just adding a save() method to the child models that calls invalidate_model on the parent a sanish way to get around this for now?

Gillingham avatar Sep 18 '14 16:09 Gillingham

@Suor sorry for digging into such an old ticket. Is there anything that can be done to mitigate this issue? I'm using Wagtail CMS which uses concepts of Page (base model with few fields) and SomeConcretePage (extends Page with additional fields using multi-table inheritance).

The problem im observing is that while caching works fine, invalidation is not. For time being I'm thinking either not to use it for this kind of models or doing some custom aggressive cache invalidation.

pySilver avatar Aug 13 '20 14:08 pySilver

I guess you can make signal handlers doing one or several invalidate_obj() calls. A concrete use case might be simple enough.

Suor avatar Aug 13 '20 16:08 Suor

I saw pending PR with some code samples, will try that! thanks!

pySilver avatar Aug 14 '20 12:08 pySilver