mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-13 23:41:55 +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 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
|
||||||
|
|||||||
@@ -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]: ...
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user