I'm using Cache Machine's Cache Manager on my non-geographic models using the pattern in the docs:
from django.db import models
from caching.base imoprt CachingManager, CachingMixin
class Zomg(CachingMixin, models.Model):
val = models.IntegerField()
objects = CachingManager()
But I have several models containing GeoDjango field types, and therefore must use GeoManager, e.g.
class RecordArea(models.Model):
polygon = models.MultiPolygonField(srid=4326)
name = models.CharField(max_length=100)
...
objects = models.GeoManager()
How can I integrate these two managers on my geographic models? I'm on Django 1.5 / Python 2.7.5.
This points to overriding CachingManager, which I get, but the Cache Machine docs make me think I need to make sure the QuerySet gets cached, i.e. becomes a CachingQuerySet:
return a CachingQuerySet from the other manager’s get_query_set method instead of subclassing CachingManager