|
|
|
@ -4,7 +4,7 @@
|
|
|
|
|
from rest_framework import serializers |
|
|
|
|
from django.utils.translation import ugettext_lazy as _ |
|
|
|
|
|
|
|
|
|
from assets.models import Node, SystemUser, Asset |
|
|
|
|
from assets.models import Node, SystemUser, Asset, Platform |
|
|
|
|
from assets.serializers import ProtocolsField |
|
|
|
|
from perms.serializers.asset.permission import ActionsField |
|
|
|
|
|
|
|
|
@ -39,7 +39,9 @@ class AssetGrantedSerializer(serializers.ModelSerializer):
|
|
|
|
|
被授权资产的数据结构 |
|
|
|
|
""" |
|
|
|
|
protocols = ProtocolsField(label=_('Protocols'), required=False, read_only=True) |
|
|
|
|
platform = serializers.ReadOnlyField(source='platform_base') |
|
|
|
|
platform = serializers.SlugRelatedField( |
|
|
|
|
slug_field='name', queryset=Platform.objects.all(), label=_("Platform") |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
class Meta: |
|
|
|
|
model = Asset |
|
|
|
|