How to temporarily disable foreign key constraint in django
<p>I have to update a record which have foreign key constraint.
i have to assign 0 to the column which is defined as foreign key
while updating django don't let me to update record. </p>

<p><strong>ForeignKey</strong> is a many-to-one relationship. Requires a positional argument: the class to which the model is related. </p>

<p>It must be <strong>Relation</strong> (class) or <strong>Null</strong> (if null allowed). You cannot set 0 (integer) to ForeignKey columnn.</p>

python django django-models