1👍
You can work with:
Author.objects.filter(book__serie=my_serie)
So if my_serie
is Conan, it will return as authors Poul Anderson, Leonard Carpenter, Lin Carter, etc. as Author
objects.
If an Author
wrote to multiple books in the my_serie
, it will appear multiple times. You can prevent that with .distinct()
[Django-doc]:
Author.objects.filter(book__serie=my_serie).distinct()
Source:stackexchange.com