I have two models :
class Individual(models.Model):
name = models.CharField(max_length=200)
is_author = models.BooleanField() active = models.BooleanField(default=True)
----------------------------------------------------------------------------------------------------
class Book(models.Model):
title = models.CharField(max_length=200)
authors = models.ManyToManyField(Individual, related_name="author_for", blank=True, null=True)
------------------------------------------------------------------------------------------------------------------
Can i make the query to get all the books that is_author?
i have tried:
>>>authors = Individual.objects.filter(is_author=True).filter(active=True)
>>>for author in authors:
print
author.name for book in author.book_set.all():
print book.title