django-quill-editor
django-quill-editor copied to clipboard
'str' object has no attribute '_committed'
Hi, I am getting below error while using a quill editor with Django.
if quill and not quill._committed: 'str' object has no attribute '_committed'
Is there any specific Django version to use or is there any other hack?
I am using Django==2.1.7 python 3.7.5 django-quill-editor==0.1.12
I'm also experiencing this issue. It occurs when I call form.save()
after a POST
request in my view. No idea what to do with this.
Were you able to resolve this issue? @parthjpandya @Kirkmania
I'm facing the same issue using django-admin version 3.1.3, and Python 3.5.3
Hi @parthjpandya @Kirkmania @erwingd
I figured out an easy way to get around the issue. Let us say you have a model called Update
with one field called message
, your ModelForm should look like this:
class CreateUpdateForm(forms.ModelForm):
message = QuillFormField()
class Meta:
model = Update
fields = ['message']
Hope this helps.
Hi raybesiga,
Thanks for your answer, but I'm facing this issue in django admin, unfortunately this didn't help...
Thanks a lot for your help,
Erwin.
Overriding/updating prepare_value
method of the field may solve this issue.
class QuillFormField(forms.fields.JSONField):
...
def prepare_value(self, value):
return value.json_string
class QuillFormField(forms.fields.JSONField):
...
def prepare_value(self, value):
if hasattr(value, "json_string"):
return value.json_string
This PR may fix this.