forked from uncloud/uncloud
d4b170f813
Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
27 lines
820 B
Python
27 lines
820 B
Python
from django.contrib.auth.models import Group
|
|
from django.contrib.auth import get_user_model
|
|
|
|
from rest_framework import serializers
|
|
|
|
from .models import VMSnapshotProduct
|
|
|
|
|
|
class UserSerializer(serializers.HyperlinkedModelSerializer):
|
|
class Meta:
|
|
model = get_user_model()
|
|
fields = ['url', 'username', 'email', 'groups']
|
|
|
|
class GroupSerializer(serializers.HyperlinkedModelSerializer):
|
|
class Meta:
|
|
model = Group
|
|
fields = ['url', 'name']
|
|
|
|
class VMSnapshotSerializer(serializers.HyperlinkedModelSerializer):
|
|
class Meta:
|
|
model = VMSnapshotProduct
|
|
fields = ['uuid', 'status', 'recurring_price', 'one_time_price' ]
|
|
|
|
class VMSnapshotCreateSerializer(serializers.HyperlinkedModelSerializer):
|
|
class Meta:
|
|
model = VMSnapshotProduct
|
|
fields = '__all__'
|