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?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/420762b0-606a-4ed7-a00b-5c1e5337d07d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to