-
-
Notifications
You must be signed in to change notification settings - Fork 302
Type stubs #742
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
JohananOppongAmoateng
wants to merge
14
commits into
jazzband:master
from
JohananOppongAmoateng:type-stubs
Closed
Type stubs #742
Changes from 2 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
8d84af6
setup
JohananOppongAmoateng 4cdf8c3
initial stubs
JohananOppongAmoateng 73db371
formatting
JohananOppongAmoateng 6c6c098
Add type hints for HttpRequest and other fields in admin and forms mo…
JohananOppongAmoateng 78b888b
Refactor type hints across multiple modules for improved type safety …
JohananOppongAmoateng 4424e41
Enhance type hints across admin modules for improved type safety and …
JohananOppongAmoateng 879bced
Merge branch 'jazzband:master' into type-stubs
JohananOppongAmoateng 9dde442
Enhance type hints across admin and form modules for improved type sa…
JohananOppongAmoateng 8919842
Merge branch 'master' into type-stubs
JohananOppongAmoateng 216a9c9
recreate lockfile
JohananOppongAmoateng f2ae07f
Merge branch 'master' of https://github.com/jazzband/django-polymorph…
JohananOppongAmoateng 4b6795c
Merge branch 'jazzband:master' into type-stubs
JohananOppongAmoateng 635fb03
Merge branch 'jazzband:master' into type-stubs
JohananOppongAmoateng 9bc5203
Merge branch 'jazzband:master' into type-stubs
JohananOppongAmoateng File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,36 @@ | ||
| [mypy] | ||
| # The mypy configurations: https://mypy.readthedocs.io/en/latest/config_file.html | ||
| python_version = 3.10 | ||
|
|
||
| check_untyped_defs = True | ||
| disallow_any_generics = True | ||
| disallow_untyped_calls = True | ||
| disallow_untyped_decorators = True | ||
| ignore_errors = False | ||
| ignore_missing_imports = True | ||
| implicit_reexport = False | ||
| strict_optional = True | ||
| strict_equality = True | ||
| no_implicit_optional = True | ||
| warn_unused_ignores = True | ||
| warn_redundant_casts = True | ||
| warn_unused_configs = True | ||
| warn_unreachable = True | ||
| warn_no_return = True | ||
| show_error_codes = True | ||
|
|
||
| plugins = | ||
| mypy_django_plugin.main | ||
|
|
||
| [mypy.plugins.django-stubs] | ||
| django_settings_module = polymorphic.tests.settings | ||
|
|
||
| [mypy-polymorphic.*] | ||
| ignore_missing_imports = True | ||
|
|
||
| [mypy-*.migrations.*] | ||
| # Django migrations should not produce any errors: | ||
| ignore_errors = True | ||
|
|
||
| [mypy-tests.*] | ||
| ignore_errors = True |
This file contains hidden or 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 hidden or 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,7 @@ | ||
| VERSION: str | ||
| __version__ = VERSION | ||
| __title__ = str | ||
| __author__ = str | ||
| __license__ = str | ||
| __copyright__ = str | ||
|
|
This file contains hidden or 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,9 @@ | ||
| from .childadmin import PolymorphicChildModelAdmin as PolymorphicChildModelAdmin | ||
| from .filters import PolymorphicChildModelFilter as PolymorphicChildModelFilter | ||
| from .forms import PolymorphicModelChoiceForm as PolymorphicModelChoiceForm | ||
| from .generic import GenericPolymorphicInlineModelAdmin as GenericPolymorphicInlineModelAdmin, GenericStackedPolymorphicInline as GenericStackedPolymorphicInline | ||
| from .helpers import PolymorphicInlineAdminForm as PolymorphicInlineAdminForm, PolymorphicInlineAdminFormSet as PolymorphicInlineAdminFormSet, PolymorphicInlineSupportMixin as PolymorphicInlineSupportMixin | ||
| from .inlines import PolymorphicInlineModelAdmin as PolymorphicInlineModelAdmin, StackedPolymorphicInline as StackedPolymorphicInline | ||
| from .parentadmin import PolymorphicParentModelAdmin as PolymorphicParentModelAdmin | ||
|
|
||
| __all__ = ['PolymorphicParentModelAdmin', 'PolymorphicChildModelAdmin', 'PolymorphicModelChoiceForm', 'PolymorphicChildModelFilter', 'PolymorphicInlineAdminForm', 'PolymorphicInlineAdminFormSet', 'PolymorphicInlineSupportMixin', 'PolymorphicInlineModelAdmin', 'StackedPolymorphicInline', 'GenericPolymorphicInlineModelAdmin', 'GenericStackedPolymorphicInline'] |
This file contains hidden or 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,30 @@ | ||
| from ..admin import PolymorphicParentModelAdmin as PolymorphicParentModelAdmin | ||
| from _typeshed import Incomplete | ||
| from django.contrib import admin | ||
| from polymorphic.utils import get_base_polymorphic_model as get_base_polymorphic_model | ||
|
|
||
| class ParentAdminNotRegistered(RuntimeError): ... | ||
|
|
||
| class PolymorphicChildModelAdmin(admin.ModelAdmin): | ||
| base_model: Incomplete | ||
| base_form: Incomplete | ||
| base_fieldsets: Incomplete | ||
| extra_fieldset_title: Incomplete | ||
| show_in_index: bool | ||
| def __init__(self, model, admin_site, *args, **kwargs) -> None: ... | ||
| def get_form(self, request, obj=None, **kwargs): ... | ||
| def get_model_perms(self, request): ... | ||
| @property | ||
| def change_form_template(self): ... | ||
| @property | ||
| def delete_confirmation_template(self): ... | ||
| @property | ||
| def object_history_template(self): ... | ||
| def response_post_save_add(self, request, obj): ... | ||
| def response_post_save_change(self, request, obj): ... | ||
| def render_change_form(self, request, context, add: bool = False, change: bool = False, form_url: str = '', obj=None): ... | ||
| def delete_view(self, request, object_id, context=None): ... | ||
| def history_view(self, request, object_id, extra_context=None): ... | ||
| def get_base_fieldsets(self, request, obj=None): ... | ||
| def get_fieldsets(self, request, obj=None): ... | ||
| def get_subclass_fields(self, request, obj=None): ... |
This file contains hidden or 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,8 @@ | ||
| from _typeshed import Incomplete | ||
| from django.contrib import admin | ||
|
|
||
| class PolymorphicChildModelFilter(admin.SimpleListFilter): | ||
| title: Incomplete | ||
| parameter_name: str | ||
| def lookups(self, request, model_admin): ... | ||
| def queryset(self, request, queryset): ... |
This file contains hidden or 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,7 @@ | ||
| from _typeshed import Incomplete | ||
| from django import forms | ||
|
|
||
| class PolymorphicModelChoiceForm(forms.Form): | ||
| type_label: Incomplete | ||
| ct_id: Incomplete | ||
| def __init__(self, *args, **kwargs) -> None: ... |
This file contains hidden or 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,18 @@ | ||
| from .inlines import PolymorphicInlineModelAdmin as PolymorphicInlineModelAdmin | ||
| from django.contrib.contenttypes.admin import GenericInlineModelAdmin | ||
| from django.utils.functional import cached_property as cached_property | ||
| from polymorphic.formsets import BaseGenericPolymorphicInlineFormSet as BaseGenericPolymorphicInlineFormSet, GenericPolymorphicFormSetChild as GenericPolymorphicFormSetChild, polymorphic_child_forms_factory as polymorphic_child_forms_factory | ||
|
|
||
| class GenericPolymorphicInlineModelAdmin(PolymorphicInlineModelAdmin, GenericInlineModelAdmin): | ||
| formset = BaseGenericPolymorphicInlineFormSet | ||
| def get_formset(self, request, obj=None, **kwargs): ... | ||
| class Child(PolymorphicInlineModelAdmin.Child): | ||
| formset_child = GenericPolymorphicFormSetChild | ||
| ct_field: str | ||
| ct_fk_field: str | ||
| @cached_property | ||
| def content_type(self): ... | ||
| def get_formset_child(self, request, obj=None, **kwargs): ... | ||
|
|
||
| class GenericStackedPolymorphicInline(GenericPolymorphicInlineModelAdmin): | ||
| template: str |
This file contains hidden or 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,21 @@ | ||
| from _typeshed import Incomplete | ||
| from django.contrib.admin.helpers import InlineAdminForm, InlineAdminFormSet | ||
| from polymorphic.formsets import BasePolymorphicModelFormSet as BasePolymorphicModelFormSet | ||
|
|
||
| class PolymorphicInlineAdminForm(InlineAdminForm): | ||
| def polymorphic_ctype_field(self): ... | ||
| @property | ||
| def is_empty(self): ... | ||
|
|
||
| class PolymorphicInlineAdminFormSet(InlineAdminFormSet): | ||
| request: Incomplete | ||
| obj: Incomplete | ||
| def __init__(self, *args, **kwargs) -> None: ... | ||
| def __iter__(self): ... | ||
| def get_child_fieldsets(self, child_inline): ... | ||
| def get_child_readonly_fields(self, child_inline): ... | ||
| def get_child_prepopulated_fields(self, child_inline): ... | ||
| def inline_formset_data(self): ... | ||
|
|
||
| class PolymorphicInlineSupportMixin: | ||
| def get_inline_formsets(self, request, formsets, inline_instances, obj=None, *args, **kwargs): ... |
This file contains hidden or 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,33 @@ | ||
| from .helpers import PolymorphicInlineSupportMixin as PolymorphicInlineSupportMixin | ||
| from _typeshed import Incomplete | ||
| from django.contrib.admin.options import InlineModelAdmin | ||
| from polymorphic.formsets import BasePolymorphicInlineFormSet as BasePolymorphicInlineFormSet, PolymorphicFormSetChild as PolymorphicFormSetChild, UnsupportedChildType as UnsupportedChildType, polymorphic_child_forms_factory as polymorphic_child_forms_factory | ||
| from polymorphic.formsets.utils import add_media as add_media | ||
|
|
||
| class PolymorphicInlineModelAdmin(InlineModelAdmin): | ||
| formset = BasePolymorphicInlineFormSet | ||
| polymorphic_media: Incomplete | ||
| extra: int | ||
| child_inlines: Incomplete | ||
| child_inline_instances: Incomplete | ||
| def __init__(self, parent_model, admin_site) -> None: ... | ||
| def get_child_inlines(self): ... | ||
| def get_child_inline_instances(self): ... | ||
| def get_child_inline_instance(self, model): ... | ||
| def get_formset(self, request, obj=None, **kwargs): ... | ||
| def get_formset_children(self, request, obj=None): ... | ||
| def get_fieldsets(self, request, obj=None): ... | ||
| def get_fields(self, request, obj=None): ... | ||
| @property | ||
| def media(self): ... | ||
| class Child(InlineModelAdmin): | ||
| formset_child = PolymorphicFormSetChild | ||
| extra: int | ||
| parent_inline: Incomplete | ||
| def __init__(self, parent_inline) -> None: ... | ||
| def get_formset(self, request, obj=None, **kwargs) -> None: ... | ||
| def get_fields(self, request, obj=None): ... | ||
| def get_formset_child(self, request, obj=None, **kwargs): ... | ||
|
|
||
| class StackedPolymorphicInline(PolymorphicInlineModelAdmin): | ||
| template: str |
This file contains hidden or 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 .forms import PolymorphicModelChoiceForm as PolymorphicModelChoiceForm | ||
| from _typeshed import Incomplete | ||
| from django.contrib import admin | ||
| from polymorphic.utils import get_base_polymorphic_model as get_base_polymorphic_model | ||
|
|
||
| class RegistrationClosed(RuntimeError): ... | ||
| class ChildAdminNotRegistered(RuntimeError): ... | ||
|
|
||
| class PolymorphicParentModelAdmin(admin.ModelAdmin): | ||
| base_model: Incomplete | ||
| child_models: Incomplete | ||
| polymorphic_list: bool | ||
| add_type_template: Incomplete | ||
| add_type_form = PolymorphicModelChoiceForm | ||
| pk_regex: str | ||
| def __init__(self, model, admin_site, *args, **kwargs) -> None: ... | ||
| def register_child(self, model, model_admin) -> None: ... | ||
| def get_child_models(self): ... | ||
| def get_child_type_choices(self, request, action): ... | ||
| def get_queryset(self, request): ... | ||
| def add_view(self, request, form_url: str = '', extra_context=None): ... | ||
| def change_view(self, request, object_id, *args, **kwargs): ... | ||
| def changeform_view(self, request, object_id=None, *args, **kwargs): ... | ||
| def history_view(self, request, object_id, extra_context=None): ... | ||
| def delete_view(self, request, object_id, extra_context=None): ... | ||
| def get_preserved_filters(self, request): ... | ||
| def get_urls(self): ... | ||
| def subclass_view(self, request, path): ... | ||
| def add_type_view(self, request, form_url: str = ''): ... | ||
| def render_add_type_form(self, request, context, form_url: str = ''): ... | ||
| @property | ||
| def change_list_template(self): ... |
This file contains hidden or 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,7 @@ | ||
| from django.apps import AppConfig | ||
|
|
||
| def check_reserved_field_names(app_configs, **kwargs): ... | ||
|
|
||
| class PolymorphicConfig(AppConfig): | ||
| name: str | ||
| verbose_name: str |
This file contains hidden or 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,16 @@ | ||
| from .managers import PolymorphicManager as PolymorphicManager | ||
| from .query import PolymorphicQuerySet as PolymorphicQuerySet | ||
| from _typeshed import Incomplete | ||
| from django.db.models.base import ModelBase | ||
|
|
||
| POLYMORPHIC_SPECIAL_Q_KWORDS: Incomplete | ||
| DUMPDATA_COMMAND: Incomplete | ||
|
|
||
| class ManagerInheritanceWarning(RuntimeWarning): ... | ||
|
|
||
| class PolymorphicModelBase(ModelBase): | ||
| def __new__(cls, model_name, bases, attrs, **kwargs): ... | ||
| @classmethod | ||
| def validate_model_manager(cls, manager, model_name, manager_name): ... | ||
| @property | ||
| def base_objects(self): ... |
Empty file.
This file contains hidden or 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,22 @@ | ||
| import extra_views | ||
| from _typeshed import Incomplete | ||
| from polymorphic.formsets import BasePolymorphicInlineFormSet, BasePolymorphicModelFormSet | ||
|
|
||
| __all__ = ['PolymorphicFormSetView', 'PolymorphicInlineFormSetView', 'PolymorphicInlineFormSet'] | ||
|
|
||
| class PolymorphicFormSetMixin: | ||
| formset_class = BasePolymorphicModelFormSet | ||
| factory_kwargs: Incomplete | ||
| formset_children: Incomplete | ||
| def get_formset_children(self): ... | ||
| def get_formset_child_kwargs(self): ... | ||
| def get_formset(self): ... | ||
|
|
||
| class PolymorphicFormSetView(PolymorphicFormSetMixin, extra_views.ModelFormSetView): | ||
| formset_class = BasePolymorphicModelFormSet | ||
|
|
||
| class PolymorphicInlineFormSetView(PolymorphicFormSetMixin, extra_views.InlineFormSetView): | ||
| formset_class = BasePolymorphicInlineFormSet | ||
|
|
||
| class PolymorphicInlineFormSet(PolymorphicFormSetMixin, extra_views.InlineFormSetFactory): | ||
| formset_class = BasePolymorphicInlineFormSet |
This file contains hidden or 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 @@ | ||
| def get_polymorphic_base_content_type(obj): ... |
This file contains hidden or 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,4 @@ | ||
| from .generic import BaseGenericPolymorphicInlineFormSet as BaseGenericPolymorphicInlineFormSet, GenericPolymorphicFormSetChild as GenericPolymorphicFormSetChild, generic_polymorphic_inlineformset_factory as generic_polymorphic_inlineformset_factory | ||
| from .models import BasePolymorphicInlineFormSet as BasePolymorphicInlineFormSet, BasePolymorphicModelFormSet as BasePolymorphicModelFormSet, PolymorphicFormSetChild as PolymorphicFormSetChild, UnsupportedChildType as UnsupportedChildType, polymorphic_child_forms_factory as polymorphic_child_forms_factory, polymorphic_inlineformset_factory as polymorphic_inlineformset_factory, polymorphic_modelformset_factory as polymorphic_modelformset_factory | ||
|
|
||
| __all__ = ['BasePolymorphicModelFormSet', 'BasePolymorphicInlineFormSet', 'PolymorphicFormSetChild', 'UnsupportedChildType', 'polymorphic_modelformset_factory', 'polymorphic_inlineformset_factory', 'polymorphic_child_forms_factory', 'BaseGenericPolymorphicInlineFormSet', 'GenericPolymorphicFormSetChild', 'generic_polymorphic_inlineformset_factory'] |
This file contains hidden or 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,13 @@ | ||
| from .models import BasePolymorphicModelFormSet as BasePolymorphicModelFormSet, PolymorphicFormSetChild as PolymorphicFormSetChild, polymorphic_child_forms_factory as polymorphic_child_forms_factory | ||
| from _typeshed import Incomplete | ||
| from django.contrib.contenttypes.forms import BaseGenericInlineFormSet | ||
|
|
||
| class GenericPolymorphicFormSetChild(PolymorphicFormSetChild): | ||
| ct_field: Incomplete | ||
| fk_field: Incomplete | ||
| def __init__(self, *args, **kwargs) -> None: ... | ||
| def get_form(self, ct_field: str = 'content_type', fk_field: str = 'object_id', **kwargs): ... | ||
|
|
||
| class BaseGenericPolymorphicInlineFormSet(BaseGenericInlineFormSet, BasePolymorphicModelFormSet): ... | ||
|
|
||
| def generic_polymorphic_inlineformset_factory(model, formset_children, form=..., formset=..., ct_field: str = 'content_type', fk_field: str = 'object_id', fields=None, exclude=None, extra: int = 1, can_order: bool = False, can_delete: bool = True, max_num=None, formfield_callback=None, validate_max: bool = False, for_concrete_model: bool = True, min_num=None, validate_min: bool = False, child_form_kwargs=None): ... |
This file contains hidden or 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,44 @@ | ||
| from .utils import add_media as add_media | ||
| from _typeshed import Incomplete | ||
| from django.forms.models import BaseInlineFormSet, BaseModelFormSet | ||
| from django.utils.functional import cached_property as cached_property | ||
| from polymorphic.models import PolymorphicModel as PolymorphicModel | ||
|
|
||
| class UnsupportedChildType(LookupError): ... | ||
|
|
||
| class PolymorphicFormSetChild: | ||
| model: Incomplete | ||
| fields: Incomplete | ||
| exclude: Incomplete | ||
| formfield_callback: Incomplete | ||
| widgets: Incomplete | ||
| localized_fields: Incomplete | ||
| labels: Incomplete | ||
| help_texts: Incomplete | ||
| error_messages: Incomplete | ||
| def __init__(self, model, form=..., fields=None, exclude=None, formfield_callback=None, widgets=None, localized_fields=None, labels=None, help_texts=None, error_messages=None) -> None: ... | ||
| @cached_property | ||
| def content_type(self): ... | ||
| def get_form(self, **kwargs): ... | ||
|
|
||
| def polymorphic_child_forms_factory(formset_children, **kwargs): ... | ||
|
|
||
| class BasePolymorphicModelFormSet(BaseModelFormSet): | ||
| child_forms: Incomplete | ||
| queryset_data: Incomplete | ||
| def __init__(self, *args, **kwargs) -> None: ... | ||
| def add_fields(self, form, index) -> None: ... | ||
| def get_form_class(self, model): ... | ||
| def is_multipart(self): ... | ||
| @property | ||
| def media(self): ... | ||
| @cached_property | ||
| def empty_forms(self): ... | ||
| @property | ||
| def empty_form(self) -> None: ... | ||
|
|
||
| def polymorphic_modelformset_factory(model, formset_children, formset=..., form=..., fields=None, exclude=None, extra: int = 1, can_order: bool = False, can_delete: bool = True, max_num=None, formfield_callback=None, widgets=None, validate_max: bool = False, localized_fields=None, labels=None, help_texts=None, error_messages=None, min_num=None, validate_min: bool = False, field_classes=None, child_form_kwargs=None): ... | ||
|
|
||
| class BasePolymorphicInlineFormSet(BaseInlineFormSet, BasePolymorphicModelFormSet): ... | ||
|
|
||
| def polymorphic_inlineformset_factory(parent_model, model, formset_children, formset=..., fk_name=None, form=..., fields=None, exclude=None, extra: int = 1, can_order: bool = False, can_delete: bool = True, max_num=None, formfield_callback=None, widgets=None, validate_max: bool = False, localized_fields=None, labels=None, help_texts=None, error_messages=None, min_num=None, validate_min: bool = False, field_classes=None, child_form_kwargs=None): ... |
This file contains hidden or 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 @@ | ||
| def add_media(dest, media) -> None: ... |
This file contains hidden or 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,15 @@ | ||
| from django.db import models | ||
| from polymorphic.query import PolymorphicQuerySet as PolymorphicQuerySet | ||
|
|
||
| __all__ = ['PolymorphicManager', 'PolymorphicQuerySet'] | ||
|
|
||
| class PolymorphicManager(models.Manager): | ||
| queryset_class = PolymorphicQuerySet | ||
| @classmethod | ||
| def from_queryset(cls, queryset_class, class_name=None): ... | ||
| def get_queryset(self): ... | ||
| def non_polymorphic(self): ... | ||
| def instance_of(self, *args): ... | ||
| def not_instance_of(self, *args): ... | ||
| def get_real_instances(self, base_result_objects=None): ... | ||
| def create_from_super(self, obj, **kwargs): ... |
This file contains hidden or 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,27 @@ | ||
| from .base import PolymorphicModelBase as PolymorphicModelBase | ||
| from .managers import PolymorphicManager as PolymorphicManager | ||
| from .query_translate import translate_polymorphic_Q_object as translate_polymorphic_Q_object | ||
| from _typeshed import Incomplete | ||
| from django.db import models | ||
|
|
||
| class PolymorphicTypeUndefined(LookupError): ... | ||
| class PolymorphicTypeInvalid(RuntimeError): ... | ||
|
|
||
| class PolymorphicModel(models.Model, metaclass=PolymorphicModelBase): | ||
| polymorphic_model_marker: bool | ||
| polymorphic_query_multiline_output: bool | ||
| polymorphic_ctype: Incomplete | ||
| polymorphic_internal_model_fields: Incomplete | ||
| objects: Incomplete | ||
| class Meta: | ||
| abstract: bool | ||
| base_manager_name: str | ||
| @classmethod | ||
| def translate_polymorphic_Q_object(cls, q): ... | ||
| def pre_save_polymorphic(self, using=...) -> None: ... | ||
| def save(self, *args, **kwargs): ... | ||
| def get_real_instance_class(self): ... | ||
| def get_real_concrete_instance_class_id(self): ... | ||
| def get_real_concrete_instance_class(self): ... | ||
| def get_real_instance(self): ... | ||
| def __init__(self, *args, **kwargs) -> None: ... |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.