uncloud-mravi/uncloud/uncloud_api/serializers.py

20 lines
499 B
Python
Raw Normal View History

from django.contrib.auth.models import Group
from django.contrib.auth import get_user_model
2020-02-20 17:58:07 +00:00
from rest_framework import serializers
class UserSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = get_user_model()
2020-02-20 17:58:07 +00:00
fields = ['url', 'username', 'email', 'groups']
class GroupSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Group
fields = ['url', 'name']
2020-02-21 23:22:42 +00:00
class VMSnapshotSerializer(serializers.Serializer):
pass