I am using Materialize CSS and Django. However Django displays checkboxes in a way Materialize does not understand, so they do not render.

How an I override CheckboxSelectMultiple to make it render correctly?

I found a question similar to my one but using Bootstrap: Overriding django's CheckboxSelectMultiple widget for Awesome Bootstrap Checkboxes

Perhaps something similar can be implemented for Django?

Django displays like this:

<label for="id_day_2">
<input type="checkbox" name="day" value="Tue" id="id_day_2">Tue</label>

But Materialize CSS expects it like this:

<input type="checkbox" id="id_day_2" name="day" value="Tue" />  
<label for="id_day_2">Name</label>

So how can I over ride the widget in order to get Django to display the code the way Materialize wants it?

0 Answers