Opened 14 years ago
Closed 14 years ago
#16175 closed New feature (fixed)
Use TemplateResponse in django.contrib.sitemaps
| Reported by: | Mathieu Pillard | Owned by: | nobody | 
|---|---|---|---|
| Component: | contrib.sitemaps | Version: | dev | 
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no | 
| Needs tests: | yes | Patch needs improvement: | no | 
| Easy pickings: | no | UI/UX: | no | 
Description
Like it was done for the admin in #15008 , it would be useful to convert django.contrib.sitemaps views to TemplateResponse, in order to help apps/projects re-use it while adding some stuff in the context.
For instance, the django-news-sitemaps news_sitemap() view is almost a straight copy/paste from django.contrib.sitemaps.views.sitemap(), just adding a couple items in the context (and changing a couple other lines but that's a different issue)
Attached is a very simple patch that does exactly that, passing all current tests.
Attachments (1)
Change History (7)
comment:1 by , 14 years ago
| Needs documentation: | set | 
|---|---|
| Triage Stage: | Unreviewed → Accepted | 
by , 14 years ago
| Attachment: | sitemaps-use-templateresponse.diff added | 
|---|
comment:2 by , 14 years ago
| Needs documentation: | unset | 
|---|
comment:3 by , 14 years ago
| Triage Stage: | Accepted → Ready for checkin | 
|---|
comment:4 by , 14 years ago
| Needs tests: | set | 
|---|---|
| Triage Stage: | Ready for checkin → Accepted | 
comment:5 by , 14 years ago
What kind of tests would be appropriate ? Just something to check if the response is a TemplateResponse? Something else ?
Patch (with docs) against [16341]