uncloud-mravi/uncloud/uncloud_vm/serializers.py

25 lines
772 B
Python

from django.contrib.auth import get_user_model
from rest_framework import serializers
from .models import VMHost, VMProduct, VMSnapshotProduct
class VMHostSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = VMHost
fields = '__all__'
class VMProductSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = VMProduct
fields = '__all__'
class VMSnapshotProductSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = VMSnapshotProduct
fields = ['uuid', 'status', 'recurring_price', 'one_time_price' ]
class VMSnapshotProductCreateSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = VMSnapshotProduct
fields = '__all__'