2016-08-23 16:13:58 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
#
|
|
|
|
|
|
|
|
from rest_framework import serializers
|
|
|
|
|
|
|
|
from .models import Role, User, UserGroup
|
|
|
|
|
|
|
|
|
2016-08-24 04:29:19 +00:00
|
|
|
class UserSerializer(serializers.ModelSerializer):
|
2016-08-23 16:13:58 +00:00
|
|
|
class Meta:
|
|
|
|
model = User
|
2016-08-24 04:29:19 +00:00
|
|
|
exclude = ['first_name', 'last_name', 'is_staff']
|
|
|
|
|
|
|
|
|
|
|
|
class UserGroupSerializer(serializers.ModelSerializer):
|
|
|
|
class Meta:
|
|
|
|
model = UserGroup
|
|
|
|
fields = '__all__'
|
|
|
|
|
|
|
|
|
|
|
|
class RoleSerializer(serializers.ModelSerializer):
|
|
|
|
class Meta:
|
|
|
|
model = Role
|
|
|
|
fields = '__all__'
|