Iwan Vosloo
unread,Aug 7, 2009, 10:32:05 AM8/7/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Paste Users
Hi there,
We have a really strange issue when using webob and django.templates
together. Any help to try and get around it would be greatly
appreciated. The code causing the breakage does not have anything
logical to do with the breaking code. THere must be some strange side-
effect.
I think its easier to try and look for it from the webob side, hence
my posing it here (see below).
We are on webob 0.9.4 and django 0.96.1
Thanks
- Iwan
from datetime import datetime
from webob import Response, UTC
import os
os.environ['DJANGO_SETTINGS_MODULE'] = '__main__' # Just to simplify
things
import django.template
templ = django.template.Template('source', 'afile') # Comment out this
line and it works
resp = Response()
stamp = datetime.fromtimestamp(123.4, tz=UTC)
resp.last_modified = stamp # Stepping into the code, this seems to
be setting things correctly
print stamp
print resp.last_modified #But something goes wrong in
translating it back to an object
assert resp.last_modified == stamp # This breaks, the reconstructed
time is 8 hours out