﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
28649	"Add ""iso_year"" lookup to DateField/DateTimeField"	Sigurd Ljødal	Sigurd Ljødal	"I found myself in the need to extract the ISO year/week-numbering year (as specified by ISO 8601) from a date/datetime field, e.g. to group values by week. This is easy with PostgreSQL:

{{{
from django.db.models.functions import Extract, ExtractWeek

SomeModel.objects.annotate(
    year=Extract('some_date', 'isoyear'),
    week=ExtractWeek('some_date'),
).values(
    'year', 'week',
).annotate(
    sum=Sum('some_field'),
)
}}}

but unfortunately extracting the week year like this does not work across databases. I've implemented an `ExtractWeekYear` class with support for all databases and will submit a pull request shortly."	New feature	closed	Database layer (models, ORM)	dev	Normal	fixed	ORM Extract	Mariusz Felisiak	Accepted	1	0	0	1	0	0
