Hi
It's great that with 1.11 django.contrib.admin and django.contrib.postgres have brought the ability to use date_hierarchy with fields from other connected tables.
I was wondering if the ability to to create a transform on a given table existed so that fields other than DateField or DateTimeField could be used? For example DateTimeTZRange. Or perhaps it could be done in the postgresql backend?
A transform example might be:
@admin.register(models.MyModel)
class MyModelAdmin(AdvancedModelAdmin):
date_hierarchy = 'date_range_to_datetime'
def date_range_to_datetime(instance):
"""
Return a datetime from django date range.
"""
return instance.range.lower
Is there anyone who might have some insight into how this could be done?