-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve
django-import-export
(#13402)
- Loading branch information
Showing
6 changed files
with
20 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,34 @@ | ||
from abc import abstractmethod | ||
from typing import IO, Any, ClassVar | ||
|
||
class BaseStorage: | ||
name: str | None | ||
read_mode: str | ||
encoding: str | None | ||
def __init__(self, *, name: str | None = None, read_mode: str = "", encoding: str | None = None) -> None: ... | ||
@abstractmethod | ||
def save(self, data: Any) -> None: ... | ||
def read(self) -> None: ... | ||
@abstractmethod | ||
def read(self) -> Any: ... # `Any` because `read` returns things from `save` | ||
@abstractmethod | ||
def remove(self) -> None: ... | ||
|
||
class TempFolderStorage(BaseStorage): | ||
def save(self, data: Any) -> None: ... | ||
def read(self): ... | ||
def read(self) -> Any: ... | ||
def remove(self) -> None: ... | ||
def get_full_path(self) -> str: ... | ||
|
||
class CacheStorage(BaseStorage): | ||
CACHE_LIFETIME: int | ||
CACHE_PREFIX: str | ||
def save(self, data: Any) -> None: ... | ||
def read(self): ... | ||
def read(self) -> Any: ... | ||
def remove(self) -> None: ... | ||
|
||
class MediaStorage(BaseStorage): | ||
MEDIA_FOLDER: ClassVar[str] | ||
def save(self, data: IO[Any]) -> None: ... | ||
def read(self): ... | ||
def read(self) -> Any: ... | ||
def remove(self) -> None: ... | ||
def get_full_path(self) -> str: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters