This example from documentation: ******** class City(models.Model):
- ... field declarations
objects = CityManager()
- an example how to cache django model methods by instance id
return history_count(self.pk) > 0
has 2 issues.
1. I think the last line should be: return offer_count(self.pk) > 0
2. How to invalidate the cached method offer_count() ? I mean what is the syntax? An example would be very helpfull