Revision c94dcec3
b/snf-astakos-app/astakos/im/management/commands/resource-list.py | ||
---|---|---|
51 | 51 |
FIELDS = { |
52 | 52 |
"id": ("id", "ID"), |
53 | 53 |
"name": ("name", "Resource Name"), |
54 |
"service type": ("service_type", "Service type"), |
|
55 |
"service origin": ("service_origin", "Service"), |
|
54 |
"service_type": ("service_type", "Service type"), |
|
55 |
"service_origin": ("service_origin", "Service"), |
|
56 |
"unit": ("unit", "Unit of measurement"), |
|
56 | 57 |
"default_quota": ("limit_with_unit", "Default Quota"), |
57 | 58 |
"description": ("desc", "Description"), |
58 | 59 |
"api_visible": ("api_visible", |
b/snf-astakos-app/astakos/im/register.py | ||
---|---|---|
38 | 38 |
|
39 | 39 |
logger = logging.getLogger(__name__) |
40 | 40 |
|
41 |
resource_fields = ['desc', 'unit', 'ui_visible', 'api_visible'] |
|
41 |
main_fields = ['desc', 'unit'] |
|
42 |
config_fields = ['ui_visible', 'api_visible'] |
|
42 | 43 |
|
43 | 44 |
|
44 | 45 |
class RegisterException(Exception): |
... | ... | |
87 | 88 |
service_type=service_type, |
88 | 89 |
service_origin=service_origin) |
89 | 90 |
exists = False |
91 |
for field in config_fields: |
|
92 |
value = resource_dict.get(field) |
|
93 |
if value is not None: |
|
94 |
setattr(r, field, value) |
|
90 | 95 |
|
91 |
for field in resource_fields:
|
|
96 |
for field in main_fields:
|
|
92 | 97 |
value = resource_dict.get(field) |
93 | 98 |
if value is not None: |
94 | 99 |
setattr(r, field, value) |
Also available in: Unified diff