Revision 5e3c112a snf-astakos-app/astakos/im/management/commands/resource-list.py
b/snf-astakos-app/astakos/im/management/commands/resource-list.py | ||
---|---|---|
54 | 54 |
"service_type": ("service_type", "Service type"), |
55 | 55 |
"service_origin": ("service_origin", "Service"), |
56 | 56 |
"unit": ("unit", "Unit of measurement"), |
57 |
"default_quota": ("limit_with_unit", "Default Quota"), |
|
57 |
"base_default": ("limit_with_unit", "Base project default quota"), |
|
58 |
"project_default": ("project_limit_with_unit", |
|
59 |
"Project default quota"), |
|
58 | 60 |
"description": ("desc", "Description"), |
59 | 61 |
"api_visible": ("api_visible", |
60 | 62 |
"Resource accessibility through the API"), |
... | ... | |
62 | 64 |
"Resource accessibility through the UI"), |
63 | 65 |
} |
64 | 66 |
|
65 |
fields = ["id", "name", "default_quota", "api_visible", "ui_visible"] |
|
66 |
|
|
67 |
def show_limit(self, resource): |
|
68 |
limit = resource.uplimit |
|
69 |
return show_resource_value(limit, resource.name, self.unit_style) |
|
67 |
fields = ["id", "name", "base_default", "project_default", |
|
68 |
"api_visible", "ui_visible"] |
|
70 | 69 |
|
71 | 70 |
def handle_args(self, *args, **options): |
72 | 71 |
self.unit_style = options['unit_style'] |
... | ... | |
74 | 73 |
|
75 | 74 |
def handle_db_objects(self, rows, *args, **kwargs): |
76 | 75 |
for resource in rows: |
77 |
resource.limit_with_unit = self.show_limit(resource) |
|
76 |
resource.limit_with_unit = show_resource_value( |
|
77 |
resource.uplimit, resource.name, self.unit_style) |
|
78 |
resource.project_limit_with_unit = show_resource_value( |
|
79 |
resource.project_default, resource.name, self.unit_style) |
Also available in: Unified diff