Reading the following documentation I deduced that partial date
settings (used in date_hierarchy filter) could be set in settings.py:
    http://docs.djangoproject.com/en/dev/ref/settings/#year-month-format
    http://docs.djangoproject.com/en/dev/ref/settings/#month-day-format

Unfortunately the localization comes before settings as you can see
<http://code.djangoproject.com/browser/django/trunk/django/utils/
translation/trans_real.py#L410> :

    from django.conf import settings
    year_month_format = ugettext('YEAR_MONTH_FORMAT')
    month_day_format = ugettext('MONTH_DAY_FORMAT')
    if year_month_format == 'YEAR_MONTH_FORMAT':
            year_month_format = settings.YEAR_MONTH_FORMAT
    if month_day_format == 'MONTH_DAY_FORMAT':
        month_day_format = settings.MONTH_DAY_FORMAT
    return year_month_format, month_day_format

I solved with an ugly monkeypatching in one of my admin.py:
    from django.utils import translation
    from django.utils.translation import trans_null
    translation.get_date_formats = trans_null.get_date_formats
    translation.get_partial_date_formats =
trans_null.get_partial_date_formats

I think the documentation should state this clearly. Or at least a
special setting could tell Django if settings.py date formats has to
be used with priority.

Ciao.
Marco.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to