898 messages

com.googlegroups.django-updates [All Lists]

2008 March [All Months]

Page 22 (Messages 526 to 550): 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36

Re: [Django Code] #6693: Inconsistency in localized datetime formats between filters and utility functions I tried to understand handling of localized datetime formats in django. It seems filters (django.template.defaultfilters.date and django.template.defaultfilters.time) use settings - without any localization. And utility functions (django.utils.translation.trans_real.get_date_formats and django.utils.translation.trans_real.get_partial_date_formats) use localized values of strings "DATE_FORMAT", "DATETIME_FORMAT", "TIME_FORMAT", "YEAR_MONTH_FORMAT" and "MONTH_DAY_FORMAT" - settings is ignored (if these strings are untranslated of if trans_null is used, utility functions behave as filters). I don't think it is right. I would like to describe main use cases (with my opinions on them) and propose an solution. =USE_I18N is False= How it should be: Values from (global or local) settings should be used everywhere. How it is: Without any problems. =USE_I18N is True, only one language is used= How it should be: As in the previous use case. And if the language is different from English, localized values should be used be default. How it is: There are some problems - in templates (through filters) values are not localized be default; in admin (through utility functions) local settings is ignored. Documentation says: "DATE_FORMAT - The default formatting to use for date fields on Django admin change-list pages." It is not true in this situation. =USE_I18N is True, more languages are used= Inconsistency in localized datetime formats between filters and utility functions How it is: There are some problems - both from the previous use case; translation of datetime formats from local settings is not simple. =Possible solution= 1. Mark DATE_FORMAT, DATETIME_FORMAT, TIME_FORMAT, YEAR_MONTH_FORMAT and MONTH_DAY_FORMAT for translation in django.conf.global_settings.py. 2. Translate these string to all languages. 3. Use translated version of formats from settings in filters. 4. Deprecate get_date_formats and trans_real.get_partial_date_formats and use ugettext/ugettext_lazy with argument DATE_FORMAT (and friends) instead. - Django Code
Re: [Django Code] #6700: smart_decorator util - Django Code
Re: [Django Code] #5789: Django LocaleMiddleware django_language should be _language - Django Code
[Django Code] #6707: Another implementation for ReverseManyRelatedObjectsDescriptor.__set__ method - Django Code
[Django Code] #6708: .order_by works ugly with JOIN - Django Code
Re: [Django Code] #6710: DATABASE_OPTIONS ignored for postgresql_psycopg2 - Django Code
Re: [Django Code] #6708: .order_by works ugly with JOIN - Django Code
Re: [Django Code] #6711: PL translation - ortographical bug - Django Code
Re: [Django Code] #6705: When using {{ form.errors }} in a template, the output uses field name instead of using field label. - Django Code
Re: [Django Code] #6723: djangonewforms-admin edit related feature (JS) - Django Code
Re: [Django Code] #6551: improve Database setup section on tutorial - Django Code
Re: [Django Code] #5884: UnicodeDecodeError attempting to render VariableDoesNotExist as a string - Django Code
Re: [Django Code] #5884: UnicodeDecodeError attempting to render VariableDoesNotExist as a string - Django Code
Re: [Django Code] #6067: Small addition to newForms documentation regarding required fields in templates - Django Code
Re: [Django Code] #6706: updating inherited models does not work - Django Code
Re: [Django Code] #6746: mark_safe produces traceback with GoogleMap object - Django Code
Re: [Django Code] #2445: [patch] allow callable values for limit_choices_to - Django Code
[Changeset] r7224 - in django/branches/queryset-refactor: django/db/models/sql tests/regressiontests/queries - nore...@djangoproject.com
Re: [Django Code] #6752: Documentation slightly unclear about "safe" strings in filters - Django Code
Re: [Django Code] #6400: extra() with LIKE and params breaks - Django Code
Re: [Django Code] #5704: Admin popup windows won't close when using application/xhtml as default content type - Django Code
Re: [Django Code] #6718: ImportError at /admin/logout/ - Django Code
Re: [Django Code] #6782: reset on apps without models causes exception - Django Code
Re: [Django Code] #6138: newforms: when accessing directly form.errors, error_class is not used - Django Code
Re: [Django Code] #5881: ProgrammingError using "save as new" with inline models - Django Code

Page 22 (Messages 526 to 550): 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36