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:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user