-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump django-import-export to 4.3.4 (#13414)
- Loading branch information
Showing
17 changed files
with
218 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
stubs/django-import-export/import_export/command_utils.pyi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from _typeshed import StrPath | ||
from typing import Any | ||
|
||
from .formats.base_formats import Format | ||
from .resources import ModelResource | ||
|
||
def get_resource_class(model_or_resource_class: str) -> ModelResource[Any]: ... | ||
|
||
MIME_TYPE_FORMAT_MAPPING: dict[str, type[Format]] | ||
|
||
def get_format_class(format_name: str, file_name: StrPath, encoding: str | None = None) -> Format: ... | ||
def get_default_format_names() -> str: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import _typeshed | ||
from logging import Logger | ||
from typing import Any | ||
|
||
logger: Logger | ||
|
||
class DeclarativeMetaclass(type): | ||
def __new__(cls: type[_typeshed.Self], name: str, bases: tuple[type[Any], ...], attrs: dict[str, Any]) -> _typeshed.Self: ... | ||
|
||
class ModelDeclarativeMetaclass(DeclarativeMetaclass): | ||
def __new__(cls: type[_typeshed.Self], name: str, bases: tuple[type[Any], ...], attrs: dict[str, Any]) -> _typeshed.Self: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,11 @@ | ||
from typing import Any | ||
|
||
class ImportExportError(Exception): ... | ||
class FieldError(ImportExportError): ... | ||
class WidgetError(ImportExportError): ... | ||
|
||
class ImportError(ImportExportError): | ||
error: Exception | ||
number: int | None | ||
row: dict[str, Any] | None | ||
def __init__(self, error: Exception, number: int | None = None, row: dict[str, Any] | None = None) -> None: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,38 @@ | ||
from collections.abc import Iterable, Sequence | ||
from typing import Any | ||
|
||
from django import forms | ||
from django.contrib.admin.helpers import ActionForm | ||
|
||
from .formats.base_formats import Format | ||
from .resources import Resource | ||
from .resources import ModelResource, Resource | ||
|
||
class ImportExportFormBase(forms.Form): | ||
resource: forms.ChoiceField | ||
def __init__(self, *args: Any, resources: list[type[Resource[Any]]] | None = None, **kwargs: Any) -> None: ... | ||
format: forms.ChoiceField | ||
def __init__( | ||
self, formats: list[type[Format]], resources: list[type[Resource[Any]]] | None = None, **kwargs: Any | ||
) -> None: ... | ||
|
||
class ImportForm(ImportExportFormBase): | ||
import_file: forms.FileField | ||
input_format: forms.ChoiceField | ||
def __init__(self, import_formats: list[Format], *args: Any, **kwargs: Any) -> None: ... | ||
field_order: Sequence[str] | ||
@property | ||
def media(self) -> forms.Media: ... | ||
|
||
class ConfirmImportForm(forms.Form): | ||
import_file_name: forms.CharField | ||
original_file_name: forms.CharField | ||
input_format: forms.CharField | ||
resource: forms.CharField | ||
def clean_import_file_name(self) -> str: ... | ||
|
||
class ExportForm(ImportExportFormBase): | ||
file_format: forms.ChoiceField | ||
def __init__(self, formats: list[Format], *args: Any, **kwargs: Any) -> None: ... | ||
export_items: forms.MultipleChoiceField | ||
|
||
def export_action_form_factory(formats: list[tuple[str, str]]) -> type[ActionForm]: ... | ||
class SelectableFieldsExportForm(ExportForm): | ||
resources: Iterable[ModelResource[Any]] | ||
is_selectable_fields_form: bool | ||
resource_fields: dict[str, list[str]] | ||
@staticmethod | ||
def create_boolean_field_name(resource: ModelResource[Any], field_name: str) -> str: ... | ||
def get_selected_resource(self) -> ModelResource[Any]: ... | ||
def get_selected_resource_export_fields(self) -> list[str]: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from collections.abc import Sequence | ||
from typing import Any, Generic, TypeVar | ||
|
||
from django.db.models import Model | ||
|
||
from .instance_loaders import BaseInstanceLoader | ||
|
||
_ModelT = TypeVar("_ModelT", bound=Model) | ||
|
||
class ResourceOptions(Generic[_ModelT]): | ||
model: _ModelT | str | ||
fields: Sequence[str] | None | ||
exclude: Sequence[str] | None | ||
instance_loader_class: type[BaseInstanceLoader] | None | ||
import_id_fields: Sequence[str] | ||
export_order: Sequence[str] | None | ||
import_order: Sequence[str] | None | ||
widgets: dict[str, Any] | None | ||
use_transactions: bool | None | ||
skip_unchanged: bool | ||
report_skipped: bool | ||
clean_model_instances: bool | ||
chunk_size: int | None | ||
skip_diff: bool | ||
skip_html_diff: bool | ||
use_bulk: bool | ||
batch_size: int | ||
force_init_instance: bool | ||
using_db: str | None | ||
store_row_values: bool | ||
store_instance: bool | ||
use_natural_foreign_keys: bool |
Oops, something went wrong.