1 ##############################################################################
2 # Copyright (c) 2016 Max Breitenfeldt and others.
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
11 from rest_framework import serializers
13 from account.models import UserProfile
14 from notifier.models import Notifier
17 class NotifierSerializer(serializers.ModelSerializer):
20 fields = ('id', 'title', 'content', 'user', 'sender', 'message_type', 'msg_sent')
23 class UserSerializer(serializers.ModelSerializer):
24 username = serializers.CharField(source='user.username')
28 fields = ('user', 'username', 'ssh_public_key', 'pgp_public_key', 'email_addr')