﻿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
13935	QuerySet .dates() method should span relationships	coleifer	Valentin Golev	"In the current implementation, QuerySet.dates() cannot span relationships.  This limits the date-based generic views to only working if the date_field is on the same model as your queryset.  The actual object lookup for the date-based generic views *works* - it is when the generic view tries to build the date_list that it fails.

{{{
# here's a silly example of what I'm talking about
>>> from django.contrib.auth.models import Group, User
>>> User.objects.dates('last_login', 'year')
[datetime.datetime(2009, 1, 1, 0, 0), datetime.datetime(2010, 1, 1, 0, 0)]

>>> Group.objects.dates('user__last_login', 'year')
FieldDoesNotExist: Group has no field named 'user__last_login'
}}}

The error is raised by this call:
http://code.djangoproject.com/browser/django/trunk/django/db/models/query.py#L991

I suspect this could be tweaked by changing something around here:
http://code.djangoproject.com/browser/django/trunk/django/db/models/sql/subqueries.py#L187"		closed	Database layer (models, ORM)	1.2		fixed		ego@…	Ready for checkin	1	0	0	0	0	0
