mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-18 01:45:59 +08:00
initial commit
This commit is contained in:
6
django/core/management/commands/check.pyi
Normal file
6
django/core/management/commands/check.pyi
Normal file
@@ -0,0 +1,6 @@
|
||||
from django.core.management.base import CommandParser
|
||||
|
||||
|
||||
class Command:
|
||||
def add_arguments(self, parser: CommandParser) -> None: ...
|
||||
def handle(self, *app_labels, **options) -> None: ...
|
||||
17
django/core/management/commands/compilemessages.pyi
Normal file
17
django/core/management/commands/compilemessages.pyi
Normal file
@@ -0,0 +1,17 @@
|
||||
from django.core.management.base import CommandParser
|
||||
from typing import (
|
||||
List,
|
||||
Tuple,
|
||||
)
|
||||
|
||||
|
||||
def has_bom(fn: str) -> bool: ...
|
||||
|
||||
|
||||
def is_writable(path: str) -> bool: ...
|
||||
|
||||
|
||||
class Command:
|
||||
def add_arguments(self, parser: CommandParser) -> None: ...
|
||||
def compile_messages(self, locations: List[Tuple[str, str]]) -> None: ...
|
||||
def handle(self, **options) -> None: ...
|
||||
7
django/core/management/commands/createcachetable.pyi
Normal file
7
django/core/management/commands/createcachetable.pyi
Normal file
@@ -0,0 +1,7 @@
|
||||
from django.core.management.base import CommandParser
|
||||
|
||||
|
||||
class Command:
|
||||
def add_arguments(self, parser: CommandParser) -> None: ...
|
||||
def create_table(self, database: str, tablename: str, dry_run: bool) -> None: ...
|
||||
def handle(self, *tablenames, **options) -> None: ...
|
||||
6
django/core/management/commands/dumpdata.pyi
Normal file
6
django/core/management/commands/dumpdata.pyi
Normal file
@@ -0,0 +1,6 @@
|
||||
from django.core.management.base import CommandParser
|
||||
|
||||
|
||||
class Command:
|
||||
def add_arguments(self, parser: CommandParser) -> None: ...
|
||||
def handle(self, *app_labels, **options) -> None: ...
|
||||
6
django/core/management/commands/flush.pyi
Normal file
6
django/core/management/commands/flush.pyi
Normal file
@@ -0,0 +1,6 @@
|
||||
from django.core.management.base import CommandParser
|
||||
|
||||
|
||||
class Command:
|
||||
def add_arguments(self, parser: CommandParser) -> None: ...
|
||||
def handle(self, **options) -> None: ...
|
||||
37
django/core/management/commands/inspectdb.pyi
Normal file
37
django/core/management/commands/inspectdb.pyi
Normal file
@@ -0,0 +1,37 @@
|
||||
from collections import OrderedDict
|
||||
from django.core.management.base import CommandParser
|
||||
from django.db.backends.base.introspection import FieldInfo
|
||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
||||
from typing import (
|
||||
Any,
|
||||
Dict,
|
||||
Iterator,
|
||||
List,
|
||||
Tuple,
|
||||
Union,
|
||||
)
|
||||
|
||||
|
||||
class Command:
|
||||
def add_arguments(self, parser: CommandParser) -> None: ...
|
||||
def get_field_type(
|
||||
self,
|
||||
connection: DatabaseWrapper,
|
||||
table_name: str,
|
||||
row: FieldInfo
|
||||
) -> Union[Tuple[str, OrderedDict, List[str]], Tuple[str, OrderedDict, List[Any]]]: ...
|
||||
def get_meta(
|
||||
self,
|
||||
table_name: str,
|
||||
constraints: Dict[str, Dict[str, Union[List[str], bool, str, Tuple[str, str]]]],
|
||||
column_to_field_name: Dict[str, str],
|
||||
is_view: bool
|
||||
) -> List[str]: ...
|
||||
def handle(self, **options) -> None: ...
|
||||
def handle_inspection(self, options: Dict[str, Any]) -> Iterator[str]: ...
|
||||
def normalize_col_name(
|
||||
self,
|
||||
col_name: str,
|
||||
used_column_names: List[str],
|
||||
is_relation: bool
|
||||
) -> Union[Tuple[str, Dict[str, str], List[str]], Tuple[str, Dict[Any, Any], List[Any]]]: ...
|
||||
27
django/core/management/commands/loaddata.pyi
Normal file
27
django/core/management/commands/loaddata.pyi
Normal file
@@ -0,0 +1,27 @@
|
||||
from django.core.management.base import CommandParser
|
||||
from typing import (
|
||||
List,
|
||||
Tuple,
|
||||
Union,
|
||||
)
|
||||
|
||||
|
||||
def humanize(dirname: str) -> str: ...
|
||||
|
||||
|
||||
class Command:
|
||||
def add_arguments(self, parser: CommandParser) -> None: ...
|
||||
def find_fixtures(self, fixture_label: str) -> List[Tuple[str, str, str]]: ...
|
||||
@cached_property
|
||||
def fixture_dirs(self) -> List[str]: ...
|
||||
def handle(self, *fixture_labels, **options) -> None: ...
|
||||
def load_label(self, fixture_label: str) -> None: ...
|
||||
def loaddata(self, fixture_labels: Union[Tuple[str], Tuple[str, str]]) -> None: ...
|
||||
def parse_name(
|
||||
self,
|
||||
fixture_name: str
|
||||
) -> Union[Tuple[str, str, str], Tuple[str, str, None], Tuple[str, None, None]]: ...
|
||||
|
||||
|
||||
class SingleZipReader:
|
||||
def read(self) -> bytes: ...
|
||||
60
django/core/management/commands/makemessages.pyi
Normal file
60
django/core/management/commands/makemessages.pyi
Normal file
@@ -0,0 +1,60 @@
|
||||
from django.core.management.base import CommandParser
|
||||
from typing import (
|
||||
List,
|
||||
Tuple,
|
||||
)
|
||||
|
||||
|
||||
def check_programs(*programs) -> None: ...
|
||||
|
||||
|
||||
def normalize_eols(raw_contents: str) -> str: ...
|
||||
|
||||
|
||||
def write_pot_file(potfile: str, msgs: str) -> None: ...
|
||||
|
||||
|
||||
class BuildFile:
|
||||
def __init__(
|
||||
self,
|
||||
command: Command,
|
||||
domain: str,
|
||||
translatable: TranslatableFile
|
||||
) -> None: ...
|
||||
def cleanup(self) -> None: ...
|
||||
@cached_property
|
||||
def is_templatized(self) -> bool: ...
|
||||
@cached_property
|
||||
def path(self) -> str: ...
|
||||
def postprocess_messages(self, msgs: str) -> str: ...
|
||||
def preprocess(self) -> None: ...
|
||||
@cached_property
|
||||
def work_path(self) -> str: ...
|
||||
|
||||
|
||||
class Command:
|
||||
def add_arguments(self, parser: CommandParser) -> None: ...
|
||||
def build_potfiles(self) -> List[str]: ...
|
||||
def copy_plural_forms(self, msgs: str, locale: str) -> str: ...
|
||||
def find_files(self, root: str) -> List[TranslatableFile]: ...
|
||||
@cached_property
|
||||
def gettext_version(self) -> Tuple[int, int, int]: ...
|
||||
def handle(self, *args, **options) -> None: ...
|
||||
def process_files(self, file_list: List[TranslatableFile]) -> None: ...
|
||||
def process_locale_dir(
|
||||
self,
|
||||
locale_dir: str,
|
||||
files: List[TranslatableFile]
|
||||
) -> None: ...
|
||||
def remove_potfiles(self) -> None: ...
|
||||
@cached_property
|
||||
def settings_available(self) -> bool: ...
|
||||
def write_po_file(self, potfile: str, locale: str) -> None: ...
|
||||
|
||||
|
||||
class TranslatableFile:
|
||||
def __eq__(self, other: TranslatableFile) -> bool: ...
|
||||
def __init__(self, dirpath: str, file_name: str, locale_dir: object) -> None: ...
|
||||
def __lt__(self, other: TranslatableFile) -> bool: ...
|
||||
@property
|
||||
def path(self) -> str: ...
|
||||
14
django/core/management/commands/makemigrations.pyi
Normal file
14
django/core/management/commands/makemigrations.pyi
Normal file
@@ -0,0 +1,14 @@
|
||||
from django.core.management.base import CommandParser
|
||||
from django.db.migrations.loader import MigrationLoader
|
||||
from django.db.migrations.migration import Migration
|
||||
from typing import (
|
||||
Dict,
|
||||
List,
|
||||
Set,
|
||||
)
|
||||
|
||||
|
||||
class Command:
|
||||
def add_arguments(self, parser: CommandParser) -> None: ...
|
||||
def handle_merge(self, loader: MigrationLoader, conflicts: Dict[str, Set[str]]) -> None: ...
|
||||
def write_migration_files(self, changes: Dict[str, List[Migration]]) -> None: ...
|
||||
14
django/core/management/commands/migrate.pyi
Normal file
14
django/core/management/commands/migrate.pyi
Normal file
@@ -0,0 +1,14 @@
|
||||
from django.core.management.base import CommandParser
|
||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
||||
from typing import (
|
||||
Any,
|
||||
List,
|
||||
Set,
|
||||
)
|
||||
|
||||
|
||||
class Command:
|
||||
def _run_checks(self, **kwargs) -> List[Any]: ...
|
||||
def add_arguments(self, parser: CommandParser) -> None: ...
|
||||
def migration_progress_callback(self, action: str, migration: Any = ..., fake: bool = ...) -> None: ...
|
||||
def sync_apps(self, connection: DatabaseWrapper, app_labels: Set[str]) -> None: ...
|
||||
9
django/core/management/commands/runserver.pyi
Normal file
9
django/core/management/commands/runserver.pyi
Normal file
@@ -0,0 +1,9 @@
|
||||
from django.core.handlers.wsgi import WSGIHandler
|
||||
from django.core.management.base import CommandParser
|
||||
|
||||
|
||||
class Command:
|
||||
def add_arguments(self, parser: CommandParser) -> None: ...
|
||||
def execute(self, *args, **options) -> None: ...
|
||||
def get_handler(self, *args, **options) -> WSGIHandler: ...
|
||||
def handle(self, *args, **options) -> None: ...
|
||||
6
django/core/management/commands/sendtestemail.pyi
Normal file
6
django/core/management/commands/sendtestemail.pyi
Normal file
@@ -0,0 +1,6 @@
|
||||
from django.core.management.base import CommandParser
|
||||
|
||||
|
||||
class Command:
|
||||
def add_arguments(self, parser: CommandParser) -> None: ...
|
||||
def handle(self, *args, **kwargs) -> None: ...
|
||||
5
django/core/management/commands/shell.pyi
Normal file
5
django/core/management/commands/shell.pyi
Normal file
@@ -0,0 +1,5 @@
|
||||
from django.core.management.base import CommandParser
|
||||
|
||||
|
||||
class Command:
|
||||
def add_arguments(self, parser: CommandParser) -> None: ...
|
||||
20
django/core/management/commands/showmigrations.pyi
Normal file
20
django/core/management/commands/showmigrations.pyi
Normal file
@@ -0,0 +1,20 @@
|
||||
from django.core.management.base import CommandParser
|
||||
from django.db.backends.sqlite3.base import DatabaseWrapper
|
||||
from django.db.migrations.loader import MigrationLoader
|
||||
from typing import List
|
||||
|
||||
|
||||
class Command:
|
||||
def _validate_app_names(self, loader: MigrationLoader, app_names: List[str]) -> None: ...
|
||||
def add_arguments(self, parser: CommandParser) -> None: ...
|
||||
def handle(self, *args, **options) -> None: ...
|
||||
def show_list(
|
||||
self,
|
||||
connection: DatabaseWrapper,
|
||||
app_names: List[str] = ...
|
||||
) -> None: ...
|
||||
def show_plan(
|
||||
self,
|
||||
connection: DatabaseWrapper,
|
||||
app_names: List[str] = ...
|
||||
) -> None: ...
|
||||
6
django/core/management/commands/sqlmigrate.pyi
Normal file
6
django/core/management/commands/sqlmigrate.pyi
Normal file
@@ -0,0 +1,6 @@
|
||||
from django.core.management.base import CommandParser
|
||||
|
||||
|
||||
class Command:
|
||||
def add_arguments(self, parser: CommandParser) -> None: ...
|
||||
def execute(self, *args, **options) -> str: ...
|
||||
6
django/core/management/commands/squashmigrations.pyi
Normal file
6
django/core/management/commands/squashmigrations.pyi
Normal file
@@ -0,0 +1,6 @@
|
||||
from django.core.management.base import CommandParser
|
||||
|
||||
|
||||
class Command:
|
||||
def add_arguments(self, parser: CommandParser) -> None: ...
|
||||
def handle(self, **options) -> None: ...
|
||||
2
django/core/management/commands/test.pyi
Normal file
2
django/core/management/commands/test.pyi
Normal file
@@ -0,0 +1,2 @@
|
||||
class Command:
|
||||
def handle(self, *test_labels, **options): ...
|
||||
2
django/core/management/commands/testserver.pyi
Normal file
2
django/core/management/commands/testserver.pyi
Normal file
@@ -0,0 +1,2 @@
|
||||
class Command:
|
||||
def handle(self, *fixture_labels, **options) -> None: ...
|
||||
Reference in New Issue
Block a user