﻿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
30602	Raise ValueError in Extract lookups that don't work properly with DurationField.	cecedille1	Hasan Ramezani	"Lookups on ExtractYear on a DurationField fails because ExtractYear has an optimisation where it compares the source date with a range of dates.

{{{
class MyModel(models.Model):
    duration = models.DurationField()

MyModel.objects.annotate(year=ExtractYear('duration')).filter(year__gt=1)
}}}
The queryset generated looks like
{{{
SELECT * FROM mymodel WHERE duration > '0001-01-01'
}}}

and it fails because interval are not comparable with dates"	Cleanup/optimization	closed	Database layer (models, ORM)	dev	Normal	fixed			Accepted	1	0	0	0	1	0
