mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-08 21:14:49 +08:00
67 lines
2.2 KiB
Python
67 lines
2.2 KiB
Python
from io import StringIO
|
|
from datetime import datetime
|
|
from django.core.files.base import File
|
|
from typing import (
|
|
Any,
|
|
List,
|
|
Optional,
|
|
Tuple,
|
|
Union,
|
|
)
|
|
|
|
|
|
def get_storage_class(import_path: Optional[str] = ...) -> Any: ...
|
|
|
|
|
|
class FileSystemStorage:
|
|
def __init__(
|
|
self,
|
|
location: Optional[str] = ...,
|
|
base_url: Optional[str] = ...,
|
|
file_permissions_mode: Optional[int] = ...,
|
|
directory_permissions_mode: Optional[int] = ...
|
|
) -> None: ...
|
|
def _clear_cached_properties(self, setting: str, **kwargs) -> None: ...
|
|
def _datetime_from_timestamp(self, ts: float) -> datetime: ...
|
|
def _open(self, name: str, mode: str = ...) -> File: ...
|
|
def _save(self, name: str, content: File) -> str: ...
|
|
def _value_or_setting(
|
|
self,
|
|
value: Optional[Union[str, int]],
|
|
setting: Optional[Union[str, int]]
|
|
) -> Optional[Union[str, int]]: ...
|
|
@cached_property
|
|
def base_location(self) -> str: ...
|
|
@cached_property
|
|
def base_url(self) -> str: ...
|
|
def delete(self, name: str) -> None: ...
|
|
@cached_property
|
|
def directory_permissions_mode(self) -> Optional[int]: ...
|
|
def exists(self, name: str) -> bool: ...
|
|
@cached_property
|
|
def file_permissions_mode(self) -> Optional[int]: ...
|
|
def get_accessed_time(self, name: str) -> datetime: ...
|
|
def get_created_time(self, name: str) -> datetime: ...
|
|
def get_modified_time(self, name: str) -> datetime: ...
|
|
def listdir(
|
|
self,
|
|
path: str
|
|
) -> Union[Tuple[List[Any], List[Any]], Tuple[List[Any], List[str]], Tuple[List[str], List[Any]], Tuple[List[str], List[str]]]: ...
|
|
@cached_property
|
|
def location(self) -> str: ...
|
|
def path(self, name: str) -> str: ...
|
|
def size(self, name: str) -> int: ...
|
|
def url(self, name: str) -> str: ...
|
|
|
|
|
|
class Storage:
|
|
def generate_filename(self, filename: str) -> str: ...
|
|
def get_available_name(self, name: str, max_length: Optional[int] = ...) -> str: ...
|
|
def get_valid_name(self, name: str) -> str: ...
|
|
def open(self, name: str, mode: str = ...) -> File: ...
|
|
def save(
|
|
self,
|
|
name: Optional[str],
|
|
content: Union[StringIO, File],
|
|
max_length: Optional[int] = ...
|
|
) -> str: ... |