views:

179

answers:

1

If there are are no values in the table how can should the code be to indicate no name found else show the drop down box in the below code

  {% for name in dict.names %}
  <option value="{{name.id}}" {% for selected_id in selected_name %}{% ifequal name.id selected_id %} {{ selected }} {% endifequal %} {% endfor %}>{{name.firstname}}</option>{% endfor %} 
   </select>

Thanks..

+1  A: 

I'm guessing that you want for...empty pair of tags.

<select>
    {% for name in dict.names %}
    <option value="{{name.id}}" 
      {% for selected_id in selected_name %}
        {% ifequal name.id selected_id %} {{ selected }} {% endifequal %} 
      {% endfor %}>
      {{name.firstname}}
    </option>
    {% empty %}
    <option value="">No names</option>
    {% endfor %}
</select>

More details here

Łukasz
Thanks....................................
Hulk