educreations/django-ormcache

Cache not used for ForeignKey

Closed this issue · 0 comments

The cache isn't used for ForeignKeys, even when use_for_related_fields = True is set for the manager.

Django does the equivalent of Class.objects.filter(id=42).get() instead of Class.objects.get(id=42), and ormcache skips the cache lookup because the .get() call is on a filtered queryset.

Relevant ormcache code

Relevant Django code: 1.6.10, 1.7.4