Answer the question
In order to leave comments, you need to log in
How to take key value in Django templating language?
{{month[article.date.month]}}
month is a dictionary passed to the template. The month keys are of type int. I need to get month values by key in template. The key is article.date.month of type int. I can’t immediately transfer it in the view (views) before sending it to the template, since this is a piece of code from the loop (the keys are sorted out).
I will be glad for any help!
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question