mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-10 22:11:54 +08:00
Add a few missing Storage-related hints (#611)
This commit is contained in:
@@ -2,7 +2,7 @@ from collections import OrderedDict
|
||||
from typing import Any, Callable, Iterator, Optional, Tuple
|
||||
|
||||
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
|
||||
|
||||
class StaticFilesStorage(FileSystemStorage):
|
||||
@@ -52,4 +52,4 @@ class CachedStaticFilesStorage(CachedFilesMixin, StaticFilesStorage): ...
|
||||
class ManifestStaticFilesStorage(ManifestFilesMixin, StaticFilesStorage): ...
|
||||
class ConfiguredStorage(LazyObject): ...
|
||||
|
||||
staticfiles_storage: Any
|
||||
staticfiles_storage: Storage
|
||||
|
||||
@@ -42,6 +42,6 @@ class FileSystemStorage(Storage):
|
||||
|
||||
class DefaultStorage(LazyObject): ...
|
||||
|
||||
default_storage: Any
|
||||
default_storage: Storage
|
||||
|
||||
def get_storage_class(import_path: Optional[str] = ...) -> Type[Storage]: ...
|
||||
|
||||
@@ -34,7 +34,7 @@ class FileDescriptor:
|
||||
_T = TypeVar("_T", bound="Field")
|
||||
|
||||
class FileField(Field):
|
||||
storage: Any = ...
|
||||
storage: Union[Storage, Callable[[], Storage]] = ...
|
||||
upload_to: Union[str, Callable] = ...
|
||||
def __init__(
|
||||
self,
|
||||
|
||||
Reference in New Issue
Block a user