Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 21 additions & 5 deletions django-stubs/core/management/commands/loaddata.pyi
Original file line number Diff line number Diff line change
@@ -1,19 +1,35 @@
import zipfile
from typing import Iterable, List, Optional, Tuple
from typing import List, Optional, Set, Sequence, Tuple, Type

from django.apps.config import AppConfig
from django.core.management.base import BaseCommand
from django.db.models.base import Model

READ_STDIN: str = ...

class Command(BaseCommand):
ignore: bool = ...
using: str = ...
app_label: str = ...
verbosity: int = ...
excluded_models: Set[Type[Model]] = ...
excluded_apps: Set[AppConfig] = ...
format: str = ...
missing_args_message: str = ...
def loaddata(self, fixture_labels: Iterable[str]) -> None: ...
def loaddata(self, fixture_labels: Sequence[str]) -> None: ...
def load_label(self, fixture_label: str) -> None: ...
def find_fixtures(self, fixture_label: str) -> List[Optional[str]]: ...
def find_fixtures(self, fixture_label: str) -> List[Tuple[str, Optional[str], Optional[str]]]: ...
@property
def fixture_dirs(self) -> List[str]: ...
def parse_name(self, fixture_name: str) -> Tuple[str, str, str]: ...
def parse_name(self, fixture_name: str) -> Tuple[str, Optional[str], Optional[str]]: ...

class SingleZipReader(zipfile.ZipFile): ...
class SingleZipReader(zipfile.ZipFile):
# Incompatible override
# zipfile.ZipFile.read(
# self,
# name: typing.Union[typing.Text, zipfile.ZipInfo],
# pwd: Optional[bytes] = ...,
# ) -> bytes: ...
def read(self) -> bytes: ... # type: ignore[override]

def humanize(dirname: str) -> str: ...