Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 错误:当前事务被中止,在创建新记录时,在事务块结束之前忽略命令_Python_Django_Postgresql 9.1 - Fatal编程技术网

Python 错误:当前事务被中止,在创建新记录时,在事务块结束之前忽略命令

Python 错误:当前事务被中止,在创建新记录时,在事务块结束之前忽略命令,python,django,postgresql-9.1,Python,Django,Postgresql 9.1,我试图在表中创建新记录,但在下面创建记录时会出现错误 InternalError:当前事务被中止,在事务块结束之前忽略命令。此错误的原因是,我有一个如下字段,我没有在表单提交中更新该字段 depth = models.PositiveIntegerField(blank=True) 此字段在我们创建之前不能为null,null=True。 因此,我更改了上面的行,如下所示,错误已经解决 depth = models.PositiveIntegerField(null=True, blank=T

我试图在表中创建新记录,但在下面创建记录时会出现错误


InternalError:当前事务被中止,在事务块结束之前忽略命令。此错误的原因是,我有一个如下字段,我没有在表单提交中更新该字段

depth = models.PositiveIntegerField(blank=True)
此字段在我们创建之前不能为null,null=True。 因此,我更改了上面的行,如下所示,错误已经解决

depth = models.PositiveIntegerField(null=True, blank=True)

是postgresql数据库吗?是的,是postgresql数据库。