Using Django's class based views to create a list of multiple objects
-
22-02-2021 - |
Question
What's the correct way to extend django's class based views to display a page with a series of list objects.
Does it make sense to create a ListView class for one of the objects and then pass the data for the other object lists in the get_context function?
What's the 'right' way to do this?
La solution
I'd just write a custom class view that inherits from the TemplateView and put your logic in the get_context_data method.
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow