Reputation: 5774
I am using django-transmeta for translation. In the below code, {{ obj.description }} returns the description in the current language of django. What I need is, getting the obj.description_[lang_code]. How can I get it?
{% for lang in languages.all %}
<div id='{{ lang.code }}'>
<input type="text" name="description-{{lang.code}}" value='{{ obj.description }}'/>
</div>
{% endfor %}
Upvotes: 0
Views: 239
Reputation: 11832
As I understood from your comment you want to get description of specific language in for loop
?
then simply write a custom filter like in this way
{{ obj|get_lang_info:lang.code }}
here get_lang_info
is custom filter.
Upvotes: 0