鱼C论坛

 找回密码
 立即注册
查看: 1194|回复: 4

NOT NULL constraint failed: learning_logs_entry.owner_id

[复制链接]
发表于 2020-7-31 00:17:34 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
NOT NULL constraint failed: learning_logs_entry.owner_id

Traceback (most recent call last):
  File "F:\learning_log\ll_env\lib\site-packages\django\core\handlers\exception.py", line 34, in inner
    response = get_response(request)
  File "F:\learning_log\ll_env\lib\site-packages\django\core\handlers\base.py", line 115, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "F:\learning_log\ll_env\lib\site-packages\django\core\handlers\base.py", line 113, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "F:\learning_log\ll_env\lib\site-packages\django\contrib\auth\decorators.py", line 21, in _wrapped_view
    return view_func(request, *args, **kwargs)
  File "F:\learning_log\learning_logs\views.py", line 61, in new_entry
    new_entry.save()
  File "F:\learning_log\ll_env\lib\site-packages\django\db\models\base.py", line 745, in save
    self.save_base(using=using, force_insert=force_insert,
  File "F:\learning_log\ll_env\lib\site-packages\django\db\models\base.py", line 782, in save_base
    updated = self._save_table(
  File "F:\learning_log\ll_env\lib\site-packages\django\db\models\base.py", line 887, in _save_table
    results = self._do_insert(cls._base_manager, using, fields, returning_fields, raw)
  File "F:\learning_log\ll_env\lib\site-packages\django\db\models\base.py", line 924, in _do_insert
    return manager._insert(
  File "F:\learning_log\ll_env\lib\site-packages\django\db\models\manager.py", line 82, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "F:\learning_log\ll_env\lib\site-packages\django\db\models\query.py", line 1204, in _insert
    return query.get_compiler(using=using).execute_sql(returning_fields)
  File "F:\learning_log\ll_env\lib\site-packages\django\db\models\sql\compiler.py", line 1392, in execute_sql
    cursor.execute(sql, params)
  File "F:\learning_log\ll_env\lib\site-packages\django\db\backends\utils.py", line 100, in execute
    return super().execute(sql, params)
  File "F:\learning_log\ll_env\lib\site-packages\django\db\backends\utils.py", line 68, in execute
    return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
  File "F:\learning_log\ll_env\lib\site-packages\django\db\backends\utils.py", line 77, in _execute_with_wrappers
    return executor(sql, params, many, context)
  File "F:\learning_log\ll_env\lib\site-packages\django\db\backends\utils.py", line 86, in _execute
    return self.cursor.execute(sql, params)
  File "F:\learning_log\ll_env\lib\site-packages\django\db\utils.py", line 90, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "F:\learning_log\ll_env\lib\site-packages\django\db\backends\utils.py", line 86, in _execute
    return self.cursor.execute(sql, params)
  File "F:\learning_log\ll_env\lib\site-packages\django\db\backends\sqlite3\base.py", line 396, in execute
    return Database.Cursor.execute(self, query, params)
django.db.utils.IntegrityError: NOT NULL constraint failed: learning_logs_entry.owner_id
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

 楼主| 发表于 2020-7-31 00:18:45 | 显示全部楼层
各位大佬,有没有清楚的,帮忙解答一下
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2020-7-31 00:23:52 | 显示全部楼层
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2020-7-31 00:44:22 | 显示全部楼层
Twilight6 发表于 2020-7-31 00:23
没怎么接触 Django 你看看下面的文章能不能帮助到你:

django.db.utils.IntegrityError: NOT NULL  ...

是entry.owner_id出了问题,topic的没有

点评

好吧 那太清楚了~  发表于 2020-8-1 09:27
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-1-19 17:19

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表