mysql store JSON as longtext and form rendered as textarea, how can I render 3 checkbox ?
Searched for hours and no example what I could implement without using third party plugin, any advise?
#model
class SafetyCheck(models.Model):
user = models.ForeignKey(tech, on_delete=models.DO_NOTHING)
order_number = models.CharField(max_length=64)
order_type = models.CharField(max_length=16)
order_date = CustomDateTimeField(auto_now=True)
certification = models.JSONField(null=True)
#modelForms
class JobSafetyCheckForm((forms.ModelForm):
Meta:
model=job
fields = ['user', 'order_number ', 'order_type', 'certification']
#html render form as {{ form | crispy }}
#json data
{
"certification": {
"site": "True",
"vehicle": "False",
"ppe": "True"
}
}
This is what I would like to achieve ::