Opened 5 years ago
Last modified 5 years ago
#31729 closed Uncategorized
The documentation for ArchiveIndexView is not clear for new developers — at Initial Version
Reported by: | Kenneth Prabakaran | Owned by: | nobody |
---|---|---|---|
Component: | Documentation | Version: | 3.0 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
path('archive/',
ArchiveIndexView.as_view(model=Article, date_field="pub_date"),
name="article_archive"),
where the only mentioned parameters are model and pub_date, and the name for the template. But using this above code does lead to an error saying template not found. Where the main problem is we are supposed to
path('archive/',
ArchiveIndexView.as_view(model=Article, date_field="pub_date", template_name="article_archive.html"),
),
mention the template_name as paramter for the as_view function. I know it might be silly to just look into the class and find the attribute "template_name" but for new comers trying to implement this might think they made a mistake somewhere else since the path was taking in the name of the template.
So please do mention in the documentation