mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
update files and model to include new field
This commit is contained in:
parent
0878a199f4
commit
3fcbd8f3ac
@ -7,5 +7,7 @@ export interface PaperlessDocumentMetadata {
|
||||
|
||||
media_filename?: string
|
||||
|
||||
original_filename?: string
|
||||
|
||||
has_archive_version?: boolean
|
||||
}
|
||||
|
@ -42,6 +42,7 @@ class DocumentAdmin(admin.ModelAdmin):
|
||||
"checksum",
|
||||
"archive_filename",
|
||||
"archive_checksum",
|
||||
"original_filename",
|
||||
)
|
||||
|
||||
list_display_links = ("title",)
|
||||
|
@ -475,6 +475,7 @@ class Consumer(LoggingMixin):
|
||||
created=create_date,
|
||||
modified=create_date,
|
||||
storage_type=storage_type,
|
||||
original_filename=self.filename
|
||||
)
|
||||
|
||||
self.apply_overrides(document)
|
||||
|
@ -214,6 +214,16 @@ class Document(models.Model):
|
||||
help_text=_("Current archive filename in storage"),
|
||||
)
|
||||
|
||||
original_filename = models.FilePathField(
|
||||
_("original filename"),
|
||||
max_length=1024,
|
||||
editable=False,
|
||||
default=None,
|
||||
unique=False,
|
||||
null=True,
|
||||
help_text=_("The original name of the file when it was uploaded")
|
||||
)
|
||||
|
||||
archive_serial_number = models.IntegerField(
|
||||
_("archive serial number"),
|
||||
blank=True,
|
||||
|
@ -313,6 +313,7 @@ class DocumentViewSet(
|
||||
"original_metadata": self.get_metadata(doc.source_path, doc.mime_type),
|
||||
"archive_checksum": doc.archive_checksum,
|
||||
"archive_media_filename": doc.archive_filename,
|
||||
"original_filename": doc.original_filename,
|
||||
}
|
||||
|
||||
if doc.has_archive_version:
|
||||
|
Loading…
x
Reference in New Issue
Block a user