med/users/serializers.py

19 lines
519 B
Python
Raw Normal View History

2019-08-17 10:12:10 +00:00
from django.contrib.auth.models import Group
from rest_framework import serializers
from .models import User
class UserSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = User
fields = ['url', 'username', 'first_name', 'last_name', 'email',
2021-11-14 13:26:41 +00:00
'groups', 'phone_number', 'address', 'comment',
2019-08-17 10:12:10 +00:00
'date_joined']
class GroupSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Group
fields = ['url', 'name']