title: Unique id form field django
body: <p>I have a form, which I call inside a nested for loop in my template.</p>
  
  <p>Here's forms.py</p>
  
  <pre><code>class SubCategoryItemForm(forms.Form):
      paragraf = forms.CharField(widget=forms.TextInput(attrs={'class' : 'form-control'}), required=True, label="Paragraf")
      name = forms.CharField(widget=forms.TextInput(attrs={'class' : 'form-control'}), required=True)
      description = forms.CharField(widget=CKEditorWidget(attrs={'class' : 'form-control'}), required=True)
  </code></pre>
  
  <p>views.py</p>
  
  <pre><code>def category_view(request, cat_id):
      category = Category.objects.get(id=cat_id)
      context = {"category": category, "sub_category_item_form": SubCategoryItemForm()}
      return render(request, 'registered/category.html', context=context)
  </code></pre>
  
  <p>And in template(without the html):</p>
  
  <pre><code>{{ category.name }}
  {{ category.description }}
  {% for subcat in category.foreign_category.all %}
      {{ subcat.name }}
      {{ subcat.description }}
      &lt;form role="form" id="{{ subcat.id }}" action="{% url 'auth_sub_category_item_add' %}" method="POST"&gt;
          {% csrf_token %}
          {{ sub_category_item_form }}
          &lt;button type="submit"&gt;Save&lt;/button&gt;
      &lt;/form&gt;
  {% endfor %}
  </code></pre>
  
  <p>The issue:
  I don't know how I can set the forms field id to be unique. As there might be up to 15 of this form in the sub categories. In specific the description form field needs an unique id. The forms posts and saves, but getting an annoying js error from the CKEditorWidget:</p>
  
  <pre><code>Uncaught The editor instance "id_description" is already attached to the provided element.
  </code></pre>
  
  <p>I can suppress this by editing the js, but it would be nice to know if there's any way to set field id dynamically.</p>