mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-09 08:15:27 +01:00
some api changes
This commit is contained in:
parent
b0143a280e
commit
f33dca2904
3 changed files with 18 additions and 30 deletions
|
|
@ -58,22 +58,24 @@ class DocumentTypeField(serializers.PrimaryKeyRelatedField):
|
|||
|
||||
class DocumentSerializer(serializers.ModelSerializer):
|
||||
|
||||
correspondent = CorrespondentField(
|
||||
allow_null=True)
|
||||
tags = TagsField(many=True)
|
||||
document_type = DocumentTypeField(
|
||||
allow_null=True)
|
||||
correspondent_id = CorrespondentField(allow_null=True, source='correspondent')
|
||||
tags_id = TagsField(many=True, source='tags')
|
||||
document_type_id = DocumentTypeField(allow_null=True, source='document_type')
|
||||
|
||||
class Meta:
|
||||
model = Document
|
||||
depth = 1
|
||||
fields = (
|
||||
"id",
|
||||
"correspondent",
|
||||
"correspondent_id",
|
||||
"document_type",
|
||||
"document_type_id",
|
||||
"title",
|
||||
"content",
|
||||
"file_type",
|
||||
"tags",
|
||||
"tags_id",
|
||||
"checksum",
|
||||
"created",
|
||||
"modified",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue