title: How to set attr from model field in forms in django
body: <p>How to set specific attribute for html template based on model method return value or just a model field name? </p>
  
  <p>I have already known it's possible to override fields by <code>__init__</code> function or widgets like this:</p>
  
  <p><strong>models.py</strong></p>
  
  <pre><code>class Item(models.Model):
          title = models.CharField(verbose_name=u"name", max_length=200, blank=False, null=False)
  
          def __str__(self):
                  return ("%s" % self.title)
  
  </code></pre>
  
  <p><strong>forms.py</strong></p>
  
  <pre><code>class ItemForm(forms.ModelForm):
          class Meta:
              model = Item
  
  fields = ['title',]
  
  widgets = {
           'title': forms.RadioSelect(attrs={
                   'class': 'radioselect',
                   'item_name': 'title name?' # &lt;- i want to have title name here of each not statis string
            }),
  }
  def __init__(self, *args, **kwargs):
      super(ItemForm, self).__init__(*args, **kwargs)
            self.fields['title'].widget.attrs.update({
                    'item_name': '' # &lt;- i want to have title name here of each not statis string
            })
  </code></pre>
  
  <p>however, I want to set specific field name, based on previosly defined fields in model not just a static string like in above-mentioned example. 
  If i add <code>Item</code> into a database with <strong>title = "Apple"</strong> i want to insert this string into this attribute to have such expected result like this in templates:</p>
  
  <pre><code>&lt;input type="radio" class="radioselect" item_name="Apple"&gt;
  </code></pre>