-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
调整资源组和实例标签的多对多模型,使用Django默认的中间表 #620
Conversation
Codecov Report
@@ Coverage Diff @@
## master #620 +/- ##
=========================================
- Coverage 82.01% 81.9% -0.11%
=========================================
Files 77 77
Lines 10362 10317 -45
=========================================
- Hits 8498 8450 -48
- Misses 1864 1867 +3
Continue to review full report at Codecov.
|
可以, 舒服了, 我记得之前提过一个issue ? |
Lines 1030 to 1055 in 52f5533
1030 行这个函数和下面的重复了 |
sql/resource_group.py
Outdated
|
||
# 获取关联数据 | ||
resource_group = ResourceGroup.objects.get(group_id=group_id) | ||
rows_users = resource_group.users_set.all().filter() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
删除.filter()
@@ -21,20 +21,17 @@ class UsersAdmin(UserAdmin): | |||
('认证信息', {'fields': ('username', 'password')}), | |||
('个人信息', {'fields': ('display', 'email', 'ding_user_id', 'wx_user_id')}), | |||
('权限信息', {'fields': ('is_superuser', 'is_active', 'is_staff', 'groups', 'user_permissions')}), | |||
('其他信息', {'fields': ('date_joined',)}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个可以在页面显示
issue好像没提过, @yyukai 做过类似的修改 |
相关pr:#162 #208
调整模型配置,多对多的选择和权限组一致,配置更方便,也可以避免关联项过多时出现的效率问题