forms.py に書いた widget.renderer でエラーが出る

件名の件、css 書いて点を消しました。

目次

環境

Ubuntu 18.04LTS
Python 3.7.3
Django 2.2

やりたかったこと

以下のように書くことで、liタグに表示される点(・)が消えるらしいのだが、エラーになってしまいました。

self.fields['choice'].widget.renderer.inner_html = '{choice_value}{sub_widgets}<br>'

エラー内容

AttributeError at /polls/1/
'RadioSelect' object has no attribute 'renderer'

対策

書き方の違いかどうかは調べても見つけられませんでした。残念。よって、対策とは言わない気がするのですが、普通に css 書いて点を消すようにしました。※上記の Python の1行は削除しました。

polls/templates/polls/detail.html

<style>
    ul {
        list-style: none;
    }
</style>

<h1>{{ question.question_text }}</h1>

<form action="{% url 'polls:vote' question.id %}" method="post">
    {% csrf_token %}
    {{ form }}
    <input type="submit" value="Vote" />
</form>