Admin inline foreignkey queryset not being cached

2014-02-14 Thread john . parton
I have the Django admin configured with a TabularInline, and the inline model has a ForeignKey reference to a third model. Every row in the inline generates a new query to fetch all of the instances of the third model. Here's an overview of my code: # models.py > from django.db import models >

WHERE EXISTS / WHERE NOT EXISTS clause without using QuerySet.extra

2016-02-03 Thread john . parton
Greetings! I'm trying to refactor a query to avoid using QuerySet.extra (as per the recommendation here: https://docs.djangoproject.com/en/1.9/ref/models/querysets/#extra) Here's a simplified version of my code: # testapp.models class Parent(models.Model): pass class Child(models.Model):