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