From 0348a7a983db431889f7d404e1338f809787c5fe Mon Sep 17 00:00:00 2001 From: milovate Date: Mon, 23 Dec 2024 16:16:39 +0530 Subject: [PATCH] fix: FileMetadata export_links type definition --- daras_ai_v2/gdrive_downloader.py | 2 +- files/models.py | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/daras_ai_v2/gdrive_downloader.py b/daras_ai_v2/gdrive_downloader.py index 19e68fa2a..455273087 100644 --- a/daras_ai_v2/gdrive_downloader.py +++ b/daras_ai_v2/gdrive_downloader.py @@ -7,7 +7,7 @@ from daras_ai_v2.functional import flatmap_parallel from daras_ai_v2.exceptions import raise_for_status -docs_export_mimetype = { +DOCS_EXPORT_MIMETYPES = { "application/vnd.google-apps.document": "text/plain", "application/vnd.google-apps.spreadsheet": "text/csv", "application/vnd.google-apps.presentation": "application/vnd.openxmlformats-officedocument.presentationml.presentation", diff --git a/files/models.py b/files/models.py index afb6504cc..b03a598b3 100644 --- a/files/models.py +++ b/files/models.py @@ -7,10 +7,7 @@ class FileMetadata(models.Model): etag = models.CharField(max_length=255, null=True) mime_type = models.CharField(max_length=255, default="", blank=True) total_bytes = models.PositiveIntegerField(default=0, blank=True) - - def __init__(self, *args, **kwargs): - super().__init__(*args, **kwargs) - self.export_links = {} + export_links: dict[str, str] | None = None def __str__(self): ret = f"{self.name or 'Unnamed'} - {self.mime_type}"