{{{#!python
class Bar(models.Model):
date = models.DateField()
class Foo(models.Model):
bar = models.OneToOneField(Bar, on_delete=models.CASCADE)
}}}
with a view like this:
{{{#!python
class FooMonthArchiveView(MonthArchiveView):
queryset = Foo.objects.all()
date_field = "bar__date"
}}}
Django raises an error from `uses_datetime_field` because `bar__date`
isn't a field on the `Foo` model.
By overriding `uses_datetime_field` to just return `False` things seem to
work just fine.
I'll mark this as a new feature as it isn't explicitly documented that
this should work, and hasn't worked for quite a while (for at least since
whenever the `uses_datetime_field property` was introduced)
--
Ticket URL: <https://code.djangoproject.com/ticket/32846>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* resolution: => duplicate
Comment:
This is a duplicate of #28048. There was a PR there, that needed a little
work but could be feasible if you wanted to pick it up.
--
Ticket URL: <https://code.djangoproject.com/ticket/32846#comment:1>