A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
Allow the user the specifiy the zip file name (#4189)
Trenton Hec9ebd302682
diff --git a/docs/administration.md b/docs/administration.mdindex 6e657447a..67efa83c5 100644--- a/docs/administration.md+++ b/docs/administration.md@@ -251,14 +251,15 @@ is not a TTY" errors. For example:document_exporter target [-c] [-d] [-f] [-na] [-nt] [-p] [-sm] [-z]optional arguments:--c, --compare-checksums--d, --delete--f, --use-filename-format+-c, --compare-checksums+-d, --delete+-f, --use-filename-format-na, --no-archive-nt, --no-thumbnail--p, --use-folder-prefix+-p, --use-folder-prefix-sm, --split-manifest--z --zip+-z, --zip+-zn, --zip-name````target` is a folder to which the data gets written. This includes@@ -314,7 +315,8 @@ manifest.json will still contain application wide information (e.g. tags, corresdocumenttype, etc)If `-z` or `--zip` is provided, the export will be a zip file-in the target directory, named according to the current date.+in the target directory, named according to the current local date or the+value set in `-zn` or `--zip-name`.!!! warningdiff --git a/src/documents/management/commands/document_exporter.py b/src/documents/management/commands/document_exporter.pyindex ebadafa9e..8af1c1f53 100644--- a/src/documents/management/commands/document_exporter.py+++ b/src/documents/management/commands/document_exporter.py@@ -125,6 +125,13 @@ class Command(BaseCommand):help="Export the documents to a zip file in the given directory",)+ parser.add_argument(+ "-zn",+ "--zip-name",+ default=f"export-{timezone.localdate().isoformat()}",+ help="Sets the export zip file name",+ )+parser.add_argument("--no-progress-bar",default=False,@@ -147,13 +154,13 @@ class Command(BaseCommand):def handle(self, *args, **options):self.target = Path(options["target"]).resolve()- self.split_manifest = options["split_manifest"]- self.compare_checksums = options["compare_checksums"]- self.use_filename_format = options["use_filename_format"]- self.use_folder_prefix = options["use_folder_prefix"]- self.delete = options["delete"]- self.no_archive = options["no_archive"]- self.no_thumbnail = options["no_thumbnail"]+ self.split_manifest: bool = options["split_manifest"]+ self.compare_checksums: bool = options["compare_checksums"]+ self.use_filename_format: bool = options["use_filename_format"]+ self.use_folder_prefix: bool = options["use_folder_prefix"]+ self.delete: bool = options["delete"]+ self.no_archive: bool = options["no_archive"]+ self.no_thumbnail: bool = options["no_thumbnail"]zip_export: bool = options["zip"]# If zipping, save the original target for later and@@ -189,7 +196,7 @@ class Command(BaseCommand):shutil.make_archive(os.path.join(original_target,- f"export-{timezone.localdate().isoformat()}",+ options["zip_name"],),format="zip",root_dir=temp_dir.name,