+class NavigationQuerySet(models.query.QuerySet):
+ """
+ This subclass is necessary to trigger cache clearing for Navigation when a mass update
+ or deletion is performed. For now, either action will trigger a clearing of the entire
+ navigation cache, since there's no convenient way to iterate over the changed or
+ deleted instances.
+ """
+ def update(self, *args, **kwargs):
+ super(NavigationQuerySet, self).update(*args, **kwargs)
+ Navigation.objects.clear_cache()
+
+ def delete(self, *args, **kwargs):
+ super(NavigationQuerySet, self).delete(*args, **kwargs)
+ Navigation.objects.clear_cache()
+
+