My Models:
OrderInfo is one-to-one with Print, which is a Many-to-One with Painting, which itself is a Many-to-One with Club.
class OrderInfo(models.Model):
print_ordered = models.OneToOneField(Print, blank=True)
class Print(models.Model):
painting = models.ForeignKey(Painting)
class Painting(models.Model):
club = models.ForeignKey(Club)
In my OrderInfoAdmin, I'd like to be able to sort by the related Club, but I can't figure out the syntax to do this.
I tried this, but it does not work:
class OrderInfoAdmin(admin.ModelAdmin):
list_filter = ['print_ordered__painting__club']
Any help appreciated, thanks in advance!