2016-08-23 16:13:58 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
#
|
|
|
|
|
|
|
|
from rest_framework import serializers
|
|
|
|
|
2016-08-24 09:14:21 +00:00
|
|
|
from .models import User, UserGroup
|
2016-08-23 16:13:58 +00:00
|
|
|
|
|
|
|
|
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 09:14:21 +00:00
|
|
|
exclude = [
|
|
|
|
'password', 'first_name', 'last_name', 'is_staff', 'secret_key_otp',
|
|
|
|
'private_key', 'public_key',
|
|
|
|
]
|
2016-08-24 04:29:19 +00:00
|
|
|
|
|
|
|
|
|
|
|
class UserGroupSerializer(serializers.ModelSerializer):
|
|
|
|
class Meta:
|
|
|
|
model = UserGroup
|
|
|
|
fields = '__all__'
|
|
|
|
|
|
|
|
|