Regarding 
https://docs.djangoproject.com/en/dev/ref/utils/#django.utils.timezone.override

# views.py

class TZView(DetailView):
    def dispatch(self, request, *args, **kwargs):
        with timezone.override(est_tz):  # Assuming your default
timezone is US/Pacific
            return super(TZView, self).dispatch(request, *args,
**kwargs)

Using the above view with a template which renders datetimes with
{{ foo_timestamp|localtime }} you'll notice that EST isn't reflected
in the values output by the localtime filter. This is because the
context manager returns control after dispatch is called, but the lazy
response isn't rendered to a string until later on (this can be seen
in https://gist.github.com/6259f4e3365dcdfb93e5 from django/core/
handlers/base.py).

I'm not suggesting a solution, just pointing out the problem. If there
are any suggestions as to how to fix this problem without ruining the
request handler, I'd be happy to help implement one.

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