mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	update files and model to include new field
This commit is contained in:
		 Gwyn Hannay
					Gwyn Hannay
				
			
				
					committed by
					
						 Trenton Holmes
						Trenton Holmes
					
				
			
			
				
	
			
			
			 Trenton Holmes
						Trenton Holmes
					
				
			
						parent
						
							0878a199f4
						
					
				
				
					commit
					3fcbd8f3ac
				
			| @@ -7,5 +7,7 @@ export interface PaperlessDocumentMetadata { | |||||||
|  |  | ||||||
|   media_filename?: string |   media_filename?: string | ||||||
|  |  | ||||||
|  |   original_filename?: string | ||||||
|  |  | ||||||
|   has_archive_version?: boolean |   has_archive_version?: boolean | ||||||
| } | } | ||||||
|   | |||||||
| @@ -42,6 +42,7 @@ class DocumentAdmin(admin.ModelAdmin): | |||||||
|         "checksum", |         "checksum", | ||||||
|         "archive_filename", |         "archive_filename", | ||||||
|         "archive_checksum", |         "archive_checksum", | ||||||
|  |         "original_filename", | ||||||
|     ) |     ) | ||||||
|  |  | ||||||
|     list_display_links = ("title",) |     list_display_links = ("title",) | ||||||
|   | |||||||
| @@ -475,6 +475,7 @@ class Consumer(LoggingMixin): | |||||||
|                 created=create_date, |                 created=create_date, | ||||||
|                 modified=create_date, |                 modified=create_date, | ||||||
|                 storage_type=storage_type, |                 storage_type=storage_type, | ||||||
|  |                 original_filename=self.filename | ||||||
|             ) |             ) | ||||||
|  |  | ||||||
|         self.apply_overrides(document) |         self.apply_overrides(document) | ||||||
|   | |||||||
| @@ -214,6 +214,16 @@ class Document(models.Model): | |||||||
|         help_text=_("Current archive filename in storage"), |         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 = models.IntegerField( | ||||||
|         _("archive serial number"), |         _("archive serial number"), | ||||||
|         blank=True, |         blank=True, | ||||||
|   | |||||||
| @@ -313,6 +313,7 @@ class DocumentViewSet( | |||||||
|             "original_metadata": self.get_metadata(doc.source_path, doc.mime_type), |             "original_metadata": self.get_metadata(doc.source_path, doc.mime_type), | ||||||
|             "archive_checksum": doc.archive_checksum, |             "archive_checksum": doc.archive_checksum, | ||||||
|             "archive_media_filename": doc.archive_filename, |             "archive_media_filename": doc.archive_filename, | ||||||
|  |             "original_filename": doc.original_filename, | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         if doc.has_archive_version: |         if doc.has_archive_version: | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user