I'm developing a wiki page that's basically laid out like so:
1. Page
Page ID
Page name
Has many: Categories
2. Category
Category ID
H2 title
Has many: category items
Belongs to: Page
3. Category item
Category item ID
H3 title
Body text
Image
Belongs to: Category
What I'd like to do is when I click on a Page or a Category, to see what parts of the element are attached to it (list of categories and category items when I click on a page, for example), but as far as I've got in to my Django knowledge, this requires me to use two models on a single template.
class PageView(DetailView):
model = Page
template_name = 'page.html'
This is what my view part for the "View page" looks like, when I try to use two models, it crashes. What can I do to use more than one model?