title: Django Template - How to check if dynamically constructed key has value in Object
body: <p>I've an object that contains names like</p>
  <pre><code>draft = {
    &quot;name_ar&quot;: &quot;test arabic&quot;,
    &quot;name_en&quot;: &quot;test english&quot;,
    &quot;name_tr&quot;: &quot;test turkish&quot;,
    &quot;name_nl&quot;: &quot;&quot;,
  }
  </code></pre>
  <p>and I've <code>language_code</code> variable which will have either 'ar' or 'en' values. So before checking if key has value in the object what I did is I constructed the key first like below</p>
  <pre><code>{% with name='name_'|add:language_code %}
  </code></pre>
  <p>So now my query is I want to add class <code>grey-color</code> to div container if name doesn't have value in <code>draft</code> object. How can I achieve this?</p>
  <pre><code>{% with name='name_'|add:language_code %}
     &lt;span class=&quot;secondary-title {% if not &quot;how can I check here&quot; %}grey-color{% endif %}&quot;&gt;
  {% endif %}
  </code></pre>
  <p>I'm very new to Django so happy to hear any suggestions or solution.</p>