Add key serializer, API endpoints and API tests to the django_gpg app.

This commit is contained in:
Roberto Rosario
2017-02-08 01:28:30 -04:00
parent f885d886bd
commit 651e370191
5 changed files with 146 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
from __future__ import unicode_literals
from rest_framework import serializers
from .models import Key
class KeySerializer(serializers.ModelSerializer):
class Meta:
extra_kwargs = {
'url': {'view_name': 'rest_api:key-detail'},
}
fields = (
'algorithm', 'creation_date', 'expiration_date', 'fingerprint',
'id', 'key_data', 'key_type', 'length', 'url', 'user_id'
)
model = Key