title: Django-autocomplete-light how to get data from html?
body: <p>I can't get how to fetch data from HTML-element that contains data generated by django-autocomplete-light.
  Here is a code of the form:</p>
  
  <pre><code>class ThreadForm(forms.Form):
  topic = forms.CharField(label="Topic", max_length=255)
  body = forms.CharField(label="Body", widget=forms.Textarea(attrs={'rows': '12', 'cols':'100'}))
  tags = autocomplete_light.fields.MultipleChoiceField(choices=(tuple((tag.name, tag.name) for tag in Tag.objects.all())),
                                        label='Tags',
                                        widget=autocomplete_light.widgets.MultipleChoiceWidget('TagAutocomplete',
                                                                                      attrs={'class':'form-control',
                                                                                             'placeholder':'Tag'}
                                                                                       )
                                                    )
  
  def save(self, author, created):
    topic = self.cleaned_data['topic']
    body = self.cleaned_data['body']
    tags = self.cleaned_data['tags']
    th = Thread(author = author,
                topic = topic,
                body = body,
                created = created,
                  )
    rtags = []
    for tag in tags:
        sr = Tag.objects.get(tag)
        rtags.append(sr.name)
    th.save()
    Tag.objects.update_tags(th, tags)
  </code></pre>
  
  <p>And autocomplete_light_registry.py:</p>
  
  <pre><code>from threads.models import Thread
  import autocomplete_light
  from tagging.models import Tag
  
  class TagAutocomplete(autocomplete_light.AutocompleteModelBase):
      search_fields = ['^name']
  autocomplete_light.register(Tag, TagAutocomplete, attrs={
      'data-autocomplete-minimum-characters': 1,
  },)
  </code></pre>
  
  <p>As you see I've changed the django-autocomplete app. In the base.py I found a variable <code>choice_html_format = '&lt;span data-value="%s" name="choice"&gt;%s&lt;/span&gt;'</code>
  Attribute <code>name</code> was added by me to get data like that:</p>
  
  <pre><code>tags = request.POST.get('name')
  </code></pre>
  
  <p>But this doesn't work. I'm getting an error like <code>"NoneType in not callable"</code>
  Next thing I've tried is change <code>choice_html</code> from <code>base.py</code>:</p>
  
  <pre><code>def choice_html(self, choice):
      """
      Format a choice using :py:attr:`choice_html_format`.
      """
      return self.choice_html_format % (
          escape(self.choice_value(choice)),
          escape(self.choice_label(choice)))
  </code></pre>
  
  <p>It is original function, I've changed <code>choice_value(choice)</code> to <code>choice_label(choice)</code>. And got an error <code>"invalid literal for int() with base 10: &lt;tag_name_here&gt;"</code>. Looks like <code>data-value</code> attribute is only for int() type (but I can't get where I can change it, maybe in js-function, I don't know).</p>
  
  <p>And the last, I'm trying to get the pk of each tag, and then get the name via manager. But I'm getting error <code>Cannot resolve keyword '4' into field. Choices are: id, items, name</code>. </p>
  
  <p>I absolutely sure that there is an easy way to perform the task I need.</p>