1👍
✅
You’re using the model ColorField
in your form, but those are two completely different contexts. It also looks like you’re trying to use a regular form as a ModelForm
.
Change your form to look like this:
class EventForm(forms.ModelForm):
class Meta:
model = Event
fields = ['name', 'beggining_time', 'ending_time', 'color']
This will automatically use the ColorWidget
form field widget when rendering.
Source:stackexchange.com