How would we filter for all books with titles containing the word ‘Django’?
django_books = Book.objects.filter(title__contains = 'Django')
django_books
How would we filter for all books with tag ‘Fiction’?
fiction_books = Book.objects.filter(tag='Fiction')
fiction_books
How would we filter for all authors who have written books containing the word ‘Django’? HINT: We can use the book field to refer to an author’s books, even though the Author model doesn’t explicitly contain it!
django_authors = Author.objects.filter(title__contains = 'Django')
django_authors