Django Compare Statement with field array
<p>I am trying to add a datepicker to my form and I am having a bit of trouble.  I had thought this bit of code would work but I can't seem to exclude the 'releasedate' tag within the field array.</p>

<pre><code>{% for field in form %}
    {% if field.label_tag != "releasedate" %}
    &lt;div class="form-group"&gt;
        &lt;div class="col-sm-offset-2 col-sm-10"&gt;
            &lt;span class="text-danger small"&gt;{{ field.errors }}&lt;/span&gt;
        &lt;/div&gt;
        &lt;label class="control-label col-sm-2"&gt;
            {{ field.label_tag }}
        &lt;/label&gt;
        &lt;div class="col-sm-10"&gt;
            {{ field }}
        &lt;/div&gt;
    &lt;/div&gt;
    {% endif %}
{% endfor %}
</code></pre>

<p>My views.py:</p>

<pre><code>class AlbumCreate(CreateView):
        model = music_models.Album
        fields = ['artist', 'album_title', 'genre', 'releasedate', 'notes', 'album_logo', 'rating']
</code></pre>

<p>Why am I wrong here?</p>

<p>Since I'm getting the discussion going, I suppose it doesn't hurt to ask a related question:
<a href="https://docs.djangoproject.com/ja/1.9/topics/forms/modelforms/#selecting-the-fields-to-use" rel="nofollow">https://docs.djangoproject.com/ja/1.9/topics/forms/modelforms/#selecting-the-fields-to-use</a>
According to this I can specify things like this if using the ModelForm class</p>

<pre><code>widgets = {
            'name': Textarea(attrs={'cols': 80, 'rows': 20}),
        }
</code></pre>

<p>Does the same apply when using any of the generic views?  If so, how do you apply it?</p>