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>
This commit is contained in:
Roberto Rosario
2019-02-06 21:36:27 -04:00
parent 278f97b7e4
commit 999e164c3d
6 changed files with 58 additions and 84 deletions
+5 -3
View File
@@ -5,11 +5,13 @@ from rest_framework import serializers
from .models import Key
class KeySerializer(serializers.ModelSerializer):
class KeySerializer(serializers.HyperlinkedModelSerializer):
class Meta:
extra_kwargs = {
'lookup_url_kwarg': 'key_id',
'url': {'view_name': 'rest_api:key-detail'},
'url': {
'lookup_url_kwarg': 'key_id',
'view_name': 'rest_api:key-detail'
},
}
fields = (
'algorithm', 'creation_date', 'expiration_date', 'fingerprint',