title: 'RadioSelect' object has no attribute 'renderer'
body: <p>I have made a web site by seeing django tutorial.
  <a href="https://docs.djangoproject.com/en/1.11/intro/" rel="nofollow noreferrer">https://docs.djangoproject.com/en/1.11/intro/</a></p>
  
  <p>I got an error,</p>
  
  <pre><code>AttributeError at /polls/1/
  'RadioSelect' object has no attribute 'renderer' 
  </code></pre>
  
  <p>It happens in line 21 of forms.py,which is init.
  I wrote in forms.py like</p>
  
  <pre><code>from django import forms
  
  class MyForm(forms.Form):
      text = forms.CharField(max_length=100,required=False,label='テキスト')
  
  class VoteForm(forms.Form):
      choice = forms.ModelChoiceField(
          queryset=None,
          label='選択',
          widget=forms.RadioSelect,
          empty_label=None,
          error_messages={
              'required':"You didn't select a choice.",
              'invalid_choice':"invalid choice.",
          },
      )
  
      def __init__(self,question,*args,**kwargs):
          super().__init__(*args,**kwargs)
          self.fields['choice'].queryset = question.choice_set.all()
          self.fields['choice'].widget.renderer.inner_html = '{choice_value}{sub_widgets}&lt;br&gt;'
  </code></pre>
  
  <p>Setting of radio button is written in detail.html,like</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;h1&gt;{{ question.question_text }}&lt;/h1&gt;
  {% if error_message %}&lt;p&gt;&lt;strong&gt;{{ error_message }}&lt;/strong&gt;&lt;/p&gt;{% endif %}
  
  &lt;form action="{% url 'poll_vote' question.id %}" method="post"&gt;
  &lt;!--&lt;form action="" method="post"&gt;--&gt;
      {% csrf_token %}
      {% for choice in question.choice_set.all %}
      &lt;input type="radio" name="choice" id="choice{{ forloop.counter }}" value="{{ choice.id }}" /&gt;
      &lt;label for="choice{{ forloop.counter }}"&gt;{{ choice.choice_text }}&lt;/label&gt;&lt;br /&gt;
      {% endfor %}
      &lt;!--{{ form }}--&gt;
      &lt;input type="submit" value="Vote" /&gt;
  &lt;/form&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>views.py is</p>
  
  <pre><code>from django.shortcuts import render
  from django.utils.html import mark_safe
  from .models import Question
  from django.http import HttpResponse
  from django.shortcuts import Http404
  from django.shortcuts import get_object_or_404,redirect
  from .models import Choice
  from django.views.generic import TemplateView
  from django.views.generic import DetailView
  from django.views.generic import ListView
  from .forms import MyForm
  from .forms import VoteForm
  
  
  # Create your views here.
  def index(request):
      return render(request,'polls/index.html',{
          'questions': Question.objects.all(),
      })
  
  def detail(request,pk):
      obj = get_object_or_404(Question,pk=pk)
      if request.method == "POST":
          form = VoteForm(question=obj,data=request.POST)
          if form.is_valid():
              return redirect('polls:results',pk)
      else:
          form = VoteForm(question=obj)
      return render(request,'templates/polls/detail.html',{
          'form':form,
          'question': obj,
      })
  
  def vote(request,pk):
      pass
  
  def results(request,pk):
      obj = get_object_or_404(Question,pk=pk)
      return render(request,'polls/results.html',{
          'question':obj,
      })
  
  def form_test(request):
      if request.method == "POST":
          #request.POST???
          form = MyForm(data=request.POST)
          if form.is_valid():
              pass
      else:
          form = MyForm()
      return render(request,'polls/form.html',{
          'form':form,
      })
  </code></pre>
  
  <p>Traceback is like</p>
  
  <pre><code>Traceback: File "/Users/XXX/django/django/core/handlers/exception.py" in inner 35. response = get_response(request) File "/Users/XXX/django/django/core/handlers/base.py" in _get_response 130. response = self.process_exception_by_middleware(e, request) 
  File "/Users/XXX/django/django/core/handlers/base.py" in _get_response 128. response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/Users/XXX/djangostudy/polls/views.py" in detail 40. form = VoteForm(question=obj) File "/Users/XXXi/djangostudy/polls/forms.py" in init 21. self.fields['choice'].widget.renderer.inner_html = '{choice_value}{sub_widgets}&lt;br&gt;' Exception Type: AttributeError at /polls/1/ Exception Value: 'RadioSelect' object has no attribute 'renderer'
  </code></pre>
  
  <p>I do not know how to fix it.I cannot understand why this error happen.
  WHat should I do to fix this?</p>