在使用django admin的时候 我们遇到这个错误

<class 'Salesman.admin.UsrMngUserAdmin'>: (admin.E020) The value of 'filter_horizontal[0]' must be a many-to-many field.
The value of 'raw_id_fields[0]' must be a foreign key or a many-to-many field.
raw_id_fields = ('department',)  # department必须是多对多,没有多对多的关系 就会报错
filter_horizontal = ('department',)  # department必须是多对多,没有多对多的关系 就会报错

 

相关文章:

  • 2021-06-24
  • 2021-05-24
  • 2021-12-16
  • 2021-07-10
  • 2021-10-31
  • 2021-11-21
  • 2021-11-16
  • 2021-05-03
猜你喜欢
  • 2022-12-23
  • 2021-12-16
  • 2022-12-23
  • 2022-12-23
  • 2022-02-17
  • 2022-12-23
相关资源
相似解决方案