My models:
OrderInfo is individually printable, which is a many-to-one with painting, which in itself is a many-to-one with a 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 would like to be able to sort the Club associated with it, but I cannot understand 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 is appreciated, thanks in advance!
source share