尝试在Django管理控制台中删除用户时出现编程错误

时间:2018-07-21 10:29:16

标签: django django-authentication django-database

我在线上有一个网页,并且一切正常。除非我尝试删除用户,否则会出现以下错误:

{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.}

我在nginx,gunicorn和postgresql中使用Django。

我的模型有问题吗?表avtimessolver由一种算法生成,在该算法中,我将id保存为名称,以便Django在某些查询中显示名称而不是id。

是否有任何方法可以解决此问题而无需更改表,以便删除功能也接受用户名作为输入?

感谢您的帮助。

0 个答案:

没有答案