Description

I'm not sure exactly when this changed, but I think it was in the last few weeks of development leading up to the 1.5 release.

ModelAdmin.date_hierarchy used to support fields on related models. For example, I have a model Event with a day field, which is a ForeignKey to Day, which in turn has a date field (of type DateField).

This used to work:

class EventAdmin(ModelAdmin):
date_hierarchy = 'day__date'

Suddenly, as of a recent commit, it doesn't. This isn't addressed in the documentation in any way I can find.

My apologies, I left the "Version" field at its default and was ambiguous in my description. The commit was in the last few weeks of development leading up to the 1.5 release, but you're correct, the problem exists only in master.

I don't see anywhere in the 1.6 release notes where it says that date_hierarchy no longer supports fields on related models.

Yeah, I was unclear, the commit involves some backwards incompatibility but the problem you're reporting isn't part of them. I just wanted to point out that the known incompatibilities were documented.

The bug is ​here. Django now needs to determine if the target field is a date field or a datetime field, and this line doesn't take into account relations.

This is purely a "practicality" suggestion, but given that this used to work, and it doesn't look like it will work in 1.6 final, it may be worth mentioning in the 1.6 release notes? Despite the fact that it was an unsupported configuration and was not mentioned in the docs (as far as I can tell), it worked fine, and if I'd been using it for months (after assuming it would work, trying it out, and finding that it did work) then I imagine other people might have been too.

So even just mentioning in the release notes, perhaps alongside the other date-related backwards incompatibilities, that it no longer works in 1.6 might save a bunch of people a headache!