Files
mayan-edms/mayan/apps/django_gpg/serializers.py
Roberto Rosario 999e164c3d Refactor the Django GPG app API views
Convert the Django GPG app API view to use viewsets.

Add key-list API view test.

Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
2019-02-06 21:36:27 -04:00

21 lines
546 B
Python

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