How can I selectively override a django .count() method
- by Tom Viner
I'm using postGresSQL and my main table has about 20,000 rows. Sometimes count() methods can take ages or even timeout.
Mod.manager.filter(...).count()
I need to selectively override the count() method depending on what filter has been applied.
Just having a cache of results would be a great gain but I'd like to be able to say: if filter query…