Las siguientes vistas y html se utilizan para mostrar todos los libros con detalles de autor corrosivos.
vistas.py
def client_add(request):
books = Book.objects.all()
return render_to_response('book_details.html', locals(), context_instance=RequestContext(request))
libro_detalles.html
<body>
{% for book in books %}
{{book.book_name}}
{{book.publisher_name}}
{{book.author.first_name}}
{{book.author.last_name}}
{{book.author.email}}
{{book.author.age}}
{% endif %}
</body>
Las siguientes vistas y html se utilizan para mostrar libros para detalles corrosivos de autores particulares.
vistas.py
def client_add(request):
books = Book.objects.all(author_last_name ="author_last_name")
return render_to_response('book_details.html', locals(), context_instance=RequestContext(request))
libro_detalles.html
<body>
{% for book in books %}
{{book.book_name}}
{{book.publisher_name}}
{{book.author.first_name}}
{{book.author.last_name}}
{{book.author.email}}
{{book.author.age}}
{% endif %}
</body>