Files
mayan-edms/mayan/apps/django_gpg/serializers.py
Roberto Rosario fc29309f68 Update Django GPG app
Add keyword arguments to all calls. Rename URL parameters to be
explicit ("key_id"). Add key delete view test. Update tests
to use a mixin for repeated key creation code. Grant permissions
and access the proper way using self.grant_permission and
self.grant_access.

Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
2019-01-20 18:08:47 -04:00

19 lines
501 B
Python

from __future__ import unicode_literals
from rest_framework import serializers
from .models import Key
class KeySerializer(serializers.ModelSerializer):
class Meta:
extra_kwargs = {
'lookup_url_kwarg': 'key_id',
'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