Add the ID and the URL to the checkout serializer

Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
This commit is contained in:
Roberto Rosario
2019-12-10 23:07:25 -04:00
parent 888715c3cf
commit 062b28c871
2 changed files with 8 additions and 2 deletions

View File

@@ -17,6 +17,7 @@
automatically.
- Use TemplateField for the web link template.
- Use TemplateField for smart links.
- Add the ID and the URL to the checkout serializer.
3.3.4 (2019-12-09)
==================

View File

@@ -16,7 +16,12 @@ class DocumentCheckoutSerializer(serializers.ModelSerializer):
document = DocumentSerializer()
class Meta:
fields = ('document',)
extra_kwargs = {
'url': {
'view_name': 'rest_api:checkedout-document-view'
},
}
fields = ('document', 'id', 'url')
model = DocumentCheckout
@@ -32,7 +37,7 @@ class NewDocumentCheckoutSerializer(serializers.ModelSerializer):
class Meta:
fields = (
'block_new_version', 'document', 'document_pk',
'expiration_datetime', 'id'
'expiration_datetime', 'id',
)
model = DocumentCheckout
read_only_fields = ('document',)