serializers.py
526 Bytes
from django.contrib.auth.models import Group
from rest_framework import serializers
from .models import Item, SharedItem,User
class UserSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = User
fields = '__all__'
class GroupSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Group
fields = ['url', 'name']
class ItemSerializer(serializers.ModelSerializer):
class Meta:
model = Item
fields = '__all__'