Add key serializer, API endpoints and API tests to the django_gpg app.
This commit is contained in:
17
mayan/apps/django_gpg/serializers.py
Normal file
17
mayan/apps/django_gpg/serializers.py
Normal 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
|
||||
Reference in New Issue
Block a user