views:

17

answers:

1

Hello, I start with django, and I have a little problem.

Well, I have a tuple (top) and I wanted to display an element of it according to another template value (date, which is a datetime type).

So, I did that :

{{top.date.day}}

Well it doesn't work, so I tried it :

{{ top.{{date.day}} }}

And it didn't work neither.

So what is the good way to do ?

Thanks.

A: 

Use the {% with %} tag to assign the intermediate value to another context variable first.

Ignacio Vazquez-Abrams
thanks a lot, it's work fine.
translation..