uncloud-mravi/nicohack202002/uncloud/uncloud_api/serializers.py
Nico Schottelius a5695ffa48 two more related user problems
Signed-off-by: Nico Schottelius <nico@nico-notebook.schottelius.org>
2020-02-21 11:43:17 +01:00

16 lines
437 B
Python

from django.contrib.auth.models import Group
from django.contrib.auth import get_user_model
from rest_framework import serializers
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']