__init__.py 759 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

# we don't need to deserialize, so we do not implement the abstract methods
# pylint: disable=abstract-method

from django.contrib.auth.models import Group
from rest_framework import serializers

from ...models import SSHPublicKey


class GroupSerializer(serializers.ModelSerializer):
    class Meta:
        model = Group
        fields = [
            'id',
            'name',
        ]


class SSHPublicKeySerializer(serializers.ModelSerializer):
    class Meta:
        model = SSHPublicKey
        fields = [
            'id',
            'name',
            'key',
        ]


class SSHPublicKeyRefSerializer(serializers.ModelSerializer):
    class Meta:
        model = SSHPublicKey
        fields = [
            'id',
            'name',
        ]