Hello Marc,

first, let me thank you for your work, I will run into these problems
in a couple of months, so I am happy to see you tackling the problem.

>  * IMHO, Django should localize dates, times and numbers
> automatically, when displaying values from database (another option is
> forcing to use a filter in templates, like {{ my_field|localize }} but
> I don't think it's the right way).

I have a question about your approach of putting localization into
models. In my opinion, storing data and displaying data are two
different things, so I'm in doubt of coupling these two. I can clearly
see some advantage of having specific model field types automatically
localized, but compared to translations, shouldn't localization be
explicit too? To indicate which variable should be localized? I'm
working with django/python for about half a year now, so maybe I
haven't fully grasped the zen of python/django. :)

> * I think it's better to add localization stuff on the models, not
> directly on the templates, so we could want to format fields in other
> places different from templates (directly in a view...).

My reason to ask here - as I understand it, for example a datetime
field on a model is localized automatically when accessing it in a
template. Say I want to store some monetary value in the database, I
use a decimal field. How can localization on model fields know that it
is supposed to be monetary, and not some other decimal value, like
weight? Maybe one could add a CurrencyField, but what if I compute a
new monetary value in my view, that is not part of the model. This is
not going to be localized automatically, right? So as I see it, I have
model fields that implicitly will be localized when accessed in a
template, and other variables that I explicitly need to localize using
a filter.

I hope someone can help me understanding this a bit better.

Regards,
Reiner

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

Reply via email to