python - django modelmultiplechoicefield and widget checkboxselectmultiple -
i have admin interface.
here code form:
class newrolefrom(forms.form): role = forms.modelmultiplechoicefield( queryset=role.objects.all(), widget=forms.checkboxselectmultiple )
so, it's simple, have role label(role:) each role in database rendered checkbox. can role objects choosen user. @ begining of each line have bullet, how can remove it? possible add on each others attribute when define list_display
in admin.py
?
in form template iterate on roles
form.html
{% role in form.role %} <div class="checkbox"> {{ role }} </div> {% endfor %}
then pretty css.
Comments
Post a Comment