Add a few missing Storage-related hints (#611)

This commit is contained in:
Marti Raudsepp
2021-05-13 13:44:19 +03:00
committed by GitHub
parent e8d03a0e22
commit d1dd95181a
3 changed files with 4 additions and 4 deletions

View File

@@ -2,7 +2,7 @@ from collections import OrderedDict
from typing import Any, Callable, Iterator, Optional, Tuple from typing import Any, Callable, Iterator, Optional, Tuple
from django.core.files.base import File from django.core.files.base import File
from django.core.files.storage import FileSystemStorage from django.core.files.storage import FileSystemStorage, Storage
from django.utils.functional import LazyObject from django.utils.functional import LazyObject
class StaticFilesStorage(FileSystemStorage): class StaticFilesStorage(FileSystemStorage):
@@ -52,4 +52,4 @@ class CachedStaticFilesStorage(CachedFilesMixin, StaticFilesStorage): ...
class ManifestStaticFilesStorage(ManifestFilesMixin, StaticFilesStorage): ... class ManifestStaticFilesStorage(ManifestFilesMixin, StaticFilesStorage): ...
class ConfiguredStorage(LazyObject): ... class ConfiguredStorage(LazyObject): ...
staticfiles_storage: Any staticfiles_storage: Storage

View File

@@ -42,6 +42,6 @@ class FileSystemStorage(Storage):
class DefaultStorage(LazyObject): ... class DefaultStorage(LazyObject): ...
default_storage: Any default_storage: Storage
def get_storage_class(import_path: Optional[str] = ...) -> Type[Storage]: ... def get_storage_class(import_path: Optional[str] = ...) -> Type[Storage]: ...

View File

@@ -34,7 +34,7 @@ class FileDescriptor:
_T = TypeVar("_T", bound="Field") _T = TypeVar("_T", bound="Field")
class FileField(Field): class FileField(Field):
storage: Any = ... storage: Union[Storage, Callable[[], Storage]] = ...
upload_to: Union[str, Callable] = ... upload_to: Union[str, Callable] = ...
def __init__( def __init__(
self, self,