I have a form with fields "num1" and "num2".
Both are FloatField.

In templates, i have too use something like the following:
<h3><label for="num1">First Number:</label></h3>
    <p>
      {{ form.num1}}
      {% if form.num1.errors %}
        <span class="error">{{ form.num1.errors|join:", " }}</span>
          {% endif %}
    </p>
<h3><label for="num2">Second Number:</label></h3>
   <p>
      {{ form.num2}}
      {% if form.num2.errors %}
        <span class="error">{{ form.num2.errors|join:", " }}</span>
          {% endif %}
    </p>

Question:
Is there a way in Django by which I can place a variable inside a
variablename.
Something like the following:
 {% for var in var_list %}
  <p>
      {{ form.num<append var here >}}
      {% if form.num<append var here >.errors %}
        <span class="error">{{ form.num<append var here >.errors|
join:", " }}</span>
          {% endif %}
    </p>
{% endfor %}

So that the same stuff can be acheived.

This might make dynamic repeatable forms much simpler as well.

Regards,
SP

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to