How to resole Integrity Error caused by NOT NULL

22 views
Skip to first unread message

Chukwunonso Nwankpa

unread,
Mar 9, 2019, 2:29:11 AM3/9/19
to Django users
Good Morning.
I'm new to django and currently using the framework for a pet project.

I am currently trying to implement a review system.
Whereby a user can see reviews on an item and also leave a review on the item.

When I try posting a review from the user end it returns the error seen on the screenshot
From the admin area, I can add reviews without errors popping up.

Please, I need help in resolving it.
Any help would be much appreciated.
Thanks in anticipation
error_1.png
error_location.png
model_1.png
model_2.png
view.png

Vijay Khemlani

unread,
Mar 9, 2019, 7:55:44 AM3/9/19
to django...@googlegroups.com
Your assign should be 

new_material_review.material = material_instance

instead of 

new_material_review.material_instance = material_instance

that you have now

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/80453449-006b-479b-9439-e6f7a5ec30dc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Chukwunonso Nwankpa

unread,
Mar 9, 2019, 10:43:07 AM3/9/19
to django...@googlegroups.com
Thank you Vijay Khemlani
You are indeed a life saver.

Chukwunonso Nwankpa
Plot 13 Benson .O. Nwanjoku Street,
Thinkers Corner,
Emene, Enugu,
Enugu State,
South East Nigeria.
Reply all
Reply to author
Forward
0 new messages