django - 尝试在 Django 管理面板中删除用户时出现编程错误
问题描述
我在网上找到了一个网页,一切正常。除非我尝试删除用户,否则我收到以下错误:
{ProgrammingError at /admin/auth/user/
operator does not exist: text = integer
LINE 1: ...OIN "auth_user" ON ("avtimessolver"."employee_id" = "auth_us...
^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.}
我将 Django 与 nginx、gunicorn 和 postgresql 一起使用。
我的模型有什么问题吗?表 avtimessolver 是由一种算法生成的,我将 id 保存为名称,以便 Django 在某些查询中显示名称而不是 id。
有没有办法在不更改表的情况下解决这个问题,以便删除函数也接受用户名作为输入?
任何帮助表示赞赏。
解决方案
推荐阅读
- django - 如何为Django中的一个类别创建链接
- parsing - Google 电子表格:从 Google Drive 解析 .PDF
- go - 通过 stdio 连接服务器客户端
- airflow - airflow.exceptions.AirflowException: Use keyword arguments when initializing operators
- java - Why JasperViewer (Swing based component) is not dispaying report at JavaFX project?
- android - 我的 android 模拟器的互联网是否因为我在热点上而无法工作?
- excel - Excel 中 INDEX 的替代方案
- swift - 为什么不能在方法中刷新文本字段?
- google-chrome - 使用浏览器访问 url
- function - 在 julia 函数中定义变量时,我在该行收到有关未定义变量的错误