cmdb icon indicating copy to clipboard operation
cmdb copied to clipboard

对cmdb代码阅读有疑惑,希望能给予帮助user_name.auth_group_set

Open sunism opened this issue 8 years ago • 1 comments

在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的方法是来源于哪里,我在网上和代码里都没找到

sunism avatar Jun 20 '17 01:06 sunism

user_name.auth_group_set.all().filter(enable=True) 这个是查询 user_name 对应的auth_group
你搜索下 django 一对多关系操作。

leemon9527 avatar Jun 20 '17 06:06 leemon9527