I'm going to fix ticket #23242 by adding an option to approximate the
date_hierarchy options instead of calculating them exactly. The
implementation is straightforward but I'm not sure what the interface
should be.

The basic idea is instead of doing `SELECT DISTINCT date_trunc('year',
created_at) FROM table`, then a date_trunc('month', created_at) to get the
list of months, and so on, you can find the range with `SELECT
date_trunc('year', max(created_at)), date_trunc('year', min(creeated_at))`
and just assume that every year/month/day in between is filled in.

How should this feature be enabled? Should it be possible to approximate
the year list, but once you've selected the year switch to exact? I'm
thinking something like:

- approximate_date_hierarchy = False # default
- approximate_date_hierarchy = 1 # approximate years only
- approximate_date_hierarchy = 2 # approximate months and years
- approximate_date_hierarchy = 3 or True # approximate days, months, and
years

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CACPudh1jHA4eUD9Diw74R7_SEiN-KoBPFLWV0J2M7dAGEz43bg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to