Re: Not null constraint error when adding a child record .

2020-07-09 Thread sum abiut
you need to pass the instance of the requisition id to your form before you can save it. You can try this: myrequistion=requistion.objects.get(id=requistion_id) form=RequistiondetailForm(request.POST, inctance= myrequistion) if form.is_valid() form.save()

Re: Not null constraint error when adding a child record .

2020-07-09 Thread Budi Hermansyah
one of the solution is, create new URL that have hash_id of the parent, so when you submitted the form, you can get parent object using their hash_id how ab that? On Fri, Jul 10, 2020 at 10:14 AM Ashutosh Mishra < ashutoshmishra...@gmail.com> wrote: > That is a data base related error,this

Re: Not null constraint error when adding a child record .

2020-07-09 Thread Ashutosh Mishra
That is a data base related error,this happens when you have already inserted data to a field of a model then try to manipulate that model again.If you know how to handle database then delete that or,delete this whole database and start again. On Thursday, July 9, 2020 at 3:49:21 PM UTC+5:30