File: forms.pyi

package info (click to toggle)
python-django-stubs 5.2.9-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,832 kB
  • sloc: python: 5,185; makefile: 15; sh: 8
file content (47 lines) | stat: -rw-r--r-- 1,421 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
from typing import Any, TypeVar

from django.db.models import Model
from django.forms.models import BaseModelFormSet, ModelForm

_M = TypeVar("_M", bound=Model)
_ModelFormT = TypeVar("_ModelFormT", bound=ModelForm)

class BaseGenericInlineFormSet(BaseModelFormSet[_M, _ModelFormT]):
    instance: Any
    rel_name: Any
    save_as_new: Any
    def __init__(
        self,
        data: Any | None = ...,
        files: Any | None = ...,
        instance: Any | None = ...,
        save_as_new: bool = ...,
        prefix: Any | None = ...,
        queryset: Any | None = ...,
        **kwargs: Any,
    ) -> None: ...
    def initial_form_count(self) -> int: ...
    @classmethod
    def get_default_prefix(cls) -> str: ...
    def save_new(self, form: Any, commit: bool = ...) -> _M: ...

def generic_inlineformset_factory(
    model: type[_M],
    form: type[_ModelFormT] = ...,
    formset: Any = ...,
    ct_field: str = ...,
    fk_field: str = ...,
    fields: Any | None = ...,
    exclude: Any | None = ...,
    extra: int = ...,
    can_order: bool = ...,
    can_delete: bool = ...,
    max_num: Any | None = ...,
    formfield_callback: Any | None = ...,
    validate_max: bool = ...,
    for_concrete_model: bool = ...,
    min_num: Any | None = ...,
    validate_min: bool = ...,
    absolute_max: int | None = ...,
    can_delete_extra: bool = ...,
) -> type[BaseGenericInlineFormSet[_M, _ModelFormT]]: ...