Hello Danny,

On 15 janv. 2012, at 10:10, Danny W. Adair wrote:
> Is there a hook that allows the "current" timezone to be set for
> admin, so that it uses it for datetime display/submission? Maybe a
> middleware that expects a session variable configured/named in
> settings?

Currently, there's no built-in UI for timezone selection. However, I've 
described some ideas, along with sample code, in the documentation:
https://docs.djangoproject.com/en/dev/topics/i18n/timezones/#selecting-the-current-time-zone

There's also a sample app here: https://bitbucket.org/aaugustin/django-tz-demo

> With full timezone support I also think it may be worth adding
> timezone to the standard User model, with a default None that falls
> back to settings.TIME_ZONE (and probably another hook to override the
> default choices).


As long as Django doesn't have a schema alteration API, it's difficult to 
change the User model.

There's also the question of how to store timezones in the database. If we 
implemented this feature, we'd have to bless a timezone implementation. pytz is 
pretty much the standard, and it's highly recommended, but it's possible to use 
another implementation of tzinfo classes if you desire.


For these reasons, I think it's better to leave the field open and see what 
emerges. I don't want to bless an implementation of "per-user time zone 
selection" now, because I don't believe we can come up with a sufficiently 
generic one at this point. Maybe when we have more hindsight...

Best regards,

-- 
Aymeric Augustin.


-- 
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