Issue #2 new

documentation improvements

stranger_ffm
created an issue

This example from documentation:


class City(models.Model): # ... field declarations

objects = CityManager()

# an example how to cache django model methods by instance id
def has_offers(self):
    @cached(30)
    def offer_count(pk):
        return self.offer_set.count()
    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

many thanks!

Comments (2)

  1. Log in to comment