Detailsview not updating
Within the template you can access the list of books with the template variable named You can add attributes to change the default behaviour above.
For example, you can specify another template file if you need to have multiple views that use this same model, or you might want to use a different template variable name if is not intuitive for your particular template use-case.
The book detail page will display information about a specific book, accessed using the URL ) including the status, expected return date, imprint, and id.
This will allow our readers not just to learn about the book, but also to confirm whether/when it is available.
Open /catalog/and add the 'book-detail' URL mapper shown in bold below.
This path the URL pattern uses a special syntax to capture the specific id of the book that we want to see.
For example, , will capture the marked pattern and pass the value to the view as a variable "something".The page will have the same structure and navigation as all other pages in the site, and we can therefore extend the base template (base_generic.html) we created in the previous tutorial.Open /catalog/and copy in the line shown in bold below. The view function has a different format than before — that's because this view will actually be implemented as a class.As discussed above, this is the default template file expected by the generic class-based list view (for a model named variable to perform conditional processing the last time that the loop is run.The code inside the loop creates a list item for each book that shows both the title (as a link to the yet-to-be-created detail view) and the author.