gpt4 book ai didi

python - list_filter 根据 django 中的用户登录仅显示过滤记录

转载 作者:太空宇宙 更新时间:2023-11-04 06:25:32 25 4
gpt4 key购买 nike

如何根据登录用户在右侧list_filter中显示不同的记录?

eg 如果superuser登陆listfilter可以查看list_filter中branch的changelist_view中所有客户的所有branch。但是,如果客户登录,他应该只能在 django 的 list_filter 中看到他的分支

最佳答案

目前的django开发版已经支持custom list filters .据我所知,在 Django 1.3 中几乎不可能做到。如果你现在真的需要这个特性,你应该考虑切换到 dev 分支。

关于python - list_filter 根据 django 中的用户登录仅显示过滤记录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8643843/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com