-
Notifications
You must be signed in to change notification settings - Fork 28
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
feat: paas-service plan 支持多租户 #211
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,3 +28,5 @@ class Category(int, Enum): | |
|
||
# Login 服务的重定向链接字段名 | ||
REDIRECT_FIELD_NAME = "c_url" | ||
|
||
DEFAULT_TENANT_ID = "default" | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Generated by Django 4.2.16 on 2025-01-09 13:44 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('paas_service', '0008_auto_20220426_0429'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='plan', | ||
name='display_name', | ||
field=models.CharField(default='', max_length=64, verbose_name='方案展示名称'), | ||
), | ||
migrations.AddField( | ||
model_name='plan', | ||
name='tenant_id', | ||
field=models.CharField(default='default', help_text='所属租户', max_length=128), | ||
), | ||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,9 +28,10 @@ | |
from django.utils.translation import gettext_lazy as _ | ||
from jsonfield import JSONField | ||
from translated_fields import TranslatedField | ||
|
||
from blue_krill.models.fields import EncryptField | ||
|
||
from paas_service.constants import DEFAULT_TENANT_ID | ||
|
||
# Base Models start | ||
|
||
|
||
|
@@ -214,6 +215,8 @@ def render_instance_data(request: HttpRequest, instance: ServiceInstance) -> Dic | |
|
||
class Plan(UuidAuditedModel): | ||
name = models.CharField(verbose_name='方案名称', max_length=64) | ||
display_name = models.CharField("方案展示名称", max_length=64, default="") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. display_name 需要国际化 |
||
tenant_id = models.CharField(help_text="所属租户", max_length=128, default=DEFAULT_TENANT_ID) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 可以添加一个索引
|
||
|
||
# the "properties" field stores custom properties of a plan object. the property itself is | ||
# nothing more than a simple annotation. But the service hub which it was registed to may | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
[tool] | ||
[tool.poetry] | ||
name = "paas_service" | ||
version = "2.0.1" | ||
version = "2.0.2" | ||
description = "A Django application for developing BK-PaaS add-on services." | ||
readme = "README.md" | ||
authors = ["blueking <[email protected]>"] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,7 @@ | |
setup( | ||
long_description=readme, | ||
name='paas_service', | ||
version='2.0.0', | ||
version='2.0.2', | ||
python_requires='<3.12,>=3.8', | ||
author='blueking', | ||
author_email='[email protected]', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 更新相关的单测代码? |
||
|
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.
增加说明