cmdb
cmdb copied to clipboard
对cmdb代码阅读有疑惑,希望能给予帮助user_name.auth_group_set
在cmdb.accounts.auth_session中有一个auth_class函数,接收CustomUser对象 def auth_class(user): user_name = user if user_name: group_auth = user_name.auth_group_set.all().filter(enable=True)
请问 auth_group_set这个CustomUser的方法是来源于哪里,我在网上和代码里都没找到
user_name.auth_group_set.all().filter(enable=True)
这个是查询 user_name 对应的auth_group
你搜索下 django 一对多关系操作。