iommirocks / iommi

Your first pick for a django power cord
http://iommi.rocks
BSD 3-Clause "New" or "Revised" License
803 stars 51 forks source link

iommi should use select_related for nested relations when the final target is not a relation #586

Open apollo13 opened 1 month ago

apollo13 commented 1 month ago

Given the models:

class Parent(models.Model):
  x = models.TextField()

class Child(models.Model):
  fk = ForeignKey(Parent)

it would be nice if:

Table(auto__model=Child, auto__include=['fk__x'])

would automatically use select_related