Opened 10 years ago

Closed 9 years ago

Last modified 8 years ago

#328 closed enhancement (fixed)

[patch] Add a archive_week date-based generic view

Reported by: Dagur Owned by: adrian
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 10 years ago.
My implementation of archive week

Download all attachments as: .zip

Change History (11)

comment:1 Changed 10 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 10 years ago by Dagur

Alright, I'll try and contribute :)

comment:3 Changed 10 years ago by adrian

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 10 years ago by Dagur

My implementation of archive week

comment:4 Changed 10 years ago by Dagur

I took archive_month and created archive_week (see attachment)

This will need testing, but it seems to work.

comment:5 Changed 10 years ago by Dagur

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 10 years ago by Dagur

sorry I meant Sunday (spam spam spam)

comment:7 Changed 10 years ago by adrian

  • Summary changed from archive_week to Add a archive_week date-based generic view

comment:8 Changed 9 years ago by dcf

  • Summary changed from Add a archive_week date-based generic view to [patch] Add a archive_week date-based generic view

comment:9 Changed 9 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 9 years ago by adrian

  • Resolution set to fixed
  • Status changed from new to closed

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

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