Opened 11 years ago

Closed 11 years ago

Last modified 10 years ago

#328 closed enhancement (fixed)

[patch] Add a archive_week date-based generic view

Reported by: Dagur Páll Ammendrup Owned by: Adrian Holovaty
Component: Core (Other) Version:
Severity: normal Keywords: generic view archive week
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

I could really use an archive_week generic view or some way to get a similar effect because archive_day is too little and archive_month is too much.

just throwing it out there.

Attachments (1)

archive_week.txt (1.5 KB) - added by Dagur Páll Ammendrup 11 years ago.
My implementation of archive week

Download all attachments as: .zip

Change History (11)

comment:1 Changed 11 years ago by Manuzhai

Well, you could just check out /django/django/views/generic/date_based.py and add an archive_week function analogous to the archive_year and archive_day functions, shouldn't be too hard.

comment:2 Changed 11 years ago by Dagur Páll Ammendrup

Alright, I'll try and contribute :)

comment:3 Changed 11 years ago by Adrian Holovaty

archive_week would be a good addition, but the question is: How do you specify a week in the URL? Do you use the week number, the date of the first day of the week, or what?

Changed 11 years ago by Dagur Páll Ammendrup

Attachment: archive_week.txt added

My implementation of archive week

comment:4 Changed 11 years ago by Dagur Páll Ammendrup

I took archive_month and created archive_week (see attachment)

This will need testing, but it seems to work.

comment:5 Changed 11 years ago by Dagur Páll Ammendrup

I used the week number and chose monday as the first day of the week. Maybe people should be able to choose.

comment:6 Changed 11 years ago by Dagur Páll Ammendrup

sorry I meant Sunday (spam spam spam)

comment:7 Changed 11 years ago by Adrian Holovaty

Summary: archive_weekAdd a archive_week date-based generic view

comment:8 Changed 11 years ago by dcf

Summary: Add a archive_week date-based generic view[patch] Add a archive_week date-based generic view

comment:9 Changed 11 years ago by Jacob

Can you please rework this to be against magic-removal and re-submit as a patch (see http://www.djangoproject.com/documentation/contributing/#patch-style)?

comment:10 Changed 11 years ago by Adrian Holovaty

Resolution: fixed
Status: newclosed

(In [2743]) magic-removal: Fixed #328 -- Added archive_week generic view

Note: See TracTickets for help on using tickets.
Back to Top