Skip to content
Advertisement

Django Form does not save properly

I want to create a comment system. I can take username, doc_id, and comp_name, but I cannot get the comment_others. I think there is a problem saving the form. How can I fix it?

views.py

JavaScript

models.py

JavaScript

forms.py

JavaScript

template.html

JavaScript

And there are two forms on the same page. When I save this form, the other form disappears. Why it could be happening?

JavaScript

Note: RichTextField is the text field of django-ckeditor. But the problem is not relevant to that because when I change it as charfield it still doesn’t save the comment_others field.

Advertisement

Answer

forms.py

JavaScript

views.py

JavaScript

by eliminating those lines in views.py will automatically save the fields in your database.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement