Question is related to Jinja2 templating system. But I want to explain the scenario:
According to the doc, App Engine always stores and returns datetime in UTC format. I am using http://code.google.com/p/gae-pytz/ for creating required timezone.
I have TimeProperty in my Model, It is datetime.time object which in turn converted to datetime.datetime object internally.
I am sending list of model instances to jinja2 template system and rendering as shown below:
{% for p in entries %}
<tr>
<td>{{ p.time.replace(tzinfo=indian_timezone).strftime("%H:%M:%S") }}</td>
--- some other fields ---
</tr>
{% endfor %}
'entries' and 'indian_timezone' is sent from views function, which is actually "indian_timezone=pytz.timezone('Asia/Kolkata')".
We can't render in the way I am doing. So, how do I render 'indian_timezone' inside {{ }} block?
Error I got is: TypeError: tzinfo argument must be None or of a tzinfo subclass, not type 'Undefined'.
Thanks in advance..