Skip to content
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

Rgr #239

Merged
merged 3 commits into from
Jun 7, 2019
Merged

Rgr #239

merged 3 commits into from
Jun 7, 2019

Conversation

yzypals
Copy link
Collaborator

@yzypals yzypals commented May 30, 2019

拆分资源关联表为2张
将标签和实例改为关联表

@codecov
Copy link

codecov bot commented May 30, 2019

Codecov Report

Merging #239 into master will decrease coverage by <.01%.
The diff coverage is 79.14%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #239      +/-   ##
=========================================
- Coverage   83.11%   83.1%   -0.01%     
=========================================
  Files          65      65              
  Lines        8141    8231      +90     
=========================================
+ Hits         6766    6840      +74     
- Misses       1375    1391      +16
Impacted Files Coverage Δ
sql/resource_group.py 15.2% <10%> (-1.02%) ⬇️
sql/utils/tests.py 98.83% <100%> (+0.08%) ⬆️
sql/admin.py 99.05% <100%> (+0.07%) ⬆️
common/auth.py 44.73% <50%> (ø) ⬆️
sql/tests.py 95.12% <73.33%> (-0.38%) ⬇️
sql/utils/resource_group.py 89.28% <91.66%> (+3.57%) ⬆️
sql/models.py 94.89% <97.56%> (+0.09%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5ff77f7...3ca364a. Read the comment docs.

Copy link
Owner

@hhyo hhyo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这几个修改后还缺数据迁移的脚本,这块我周末处理,这周末合并发版吧

sql/models.py Outdated
class InstanceTag(models.Model):
"""实例标签配置"""
tag_code = models.CharField('标签代码', max_length=20, unique=True)
tag_name = models.CharField('标签名称', max_length=20, unique=True)
active = models.BooleanField('激活状态', default=True)
create_time = models.DateTimeField('创建时间', auto_now_add=True)
instances = models.ManyToManyField(Instance,through='InstanceTagRelations',through_fields=('instance_tag','instance'))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

关系表中已经使用外键,这个关联是为了处理什么?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以使用自带的mtm 查询

formatter: function (value, row, index) {
switch (row.object_type) {
case 0:
return "<a href=\"/admin/sql/users/" + row.object_id + "/change/\">" + value + "</a>";
return "<a href=\"/admin/sql/users/" + row.object_id + "/change/\">" + row.object_id__username + "</a>";
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个描述显示中文名display

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的 我修改下

'create_time')
rows = [row for row in rows]
if object_type == '0':
rows_obj = rows_objusers
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

搜索可以加在每个对象获取的地方,参考上面

@LeoQuote
Copy link
Collaborator

LeoQuote commented May 31, 2019

这个功能这次发布过了再合吧,先合几个bug修复,不要关pr!

@stale
Copy link

stale bot commented Jun 3, 2019

你已经很久没有回复这个issue了,如果没有进一步的信息的话, 会作为不活跃issue关闭, 感谢你对本项目的贡献。
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Jun 3, 2019
@LeoQuote LeoQuote added the enhancement New feature or request label Jun 3, 2019
@stale stale bot removed the wontfix This will not be worked on label Jun 3, 2019
@hhyo hhyo merged commit 82e8aca into hhyo:master Jun 7, 2019
@yzypals yzypals deleted the rgr branch June 7, 2019 11:16
@yzypals yzypals restored the rgr branch June 7, 2019 11:17
@yzypals yzypals deleted the rgr branch June 9, 2019 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants