1👍
✅
This seems an overly complex db structure.
But no matter how many tables you need to join, you can use the double-underscore syntax to query across the joins.
products = Product.objects.filter(levelcatitems__levelcats__levelsubs__levelzs__pk=18)
Source:stackexchange.com