mirror of
https://github.com/davidhalter/django-stubs.git
synced 2026-05-17 22:09:45 +08:00
enable some test folders, bunch of fixes
This commit is contained in:
@@ -235,7 +235,7 @@ class ModelChoiceField(ChoiceField):
|
||||
iterator: Any = ...
|
||||
empty_label: Optional[str] = ...
|
||||
queryset: Any = ...
|
||||
limit_choices_to: None = ...
|
||||
limit_choices_to: Optional[Union[Dict[str, Any], Callable[[], Any]]] = ...
|
||||
to_field_name: None = ...
|
||||
def __init__(
|
||||
self,
|
||||
@@ -248,7 +248,7 @@ class ModelChoiceField(ChoiceField):
|
||||
initial: Optional[Any] = ...,
|
||||
help_text: str = ...,
|
||||
to_field_name: Optional[Any] = ...,
|
||||
limit_choices_to: Optional[Any] = ...,
|
||||
limit_choices_to: Optional[Union[Dict[str, Any], Callable[[], Any]]] = ...,
|
||||
**kwargs: Any
|
||||
) -> None: ...
|
||||
def get_limit_choices_to(self) -> Optional[Union[Dict[str, datetime], Q, MagicMock]]: ...
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from collections import UserList
|
||||
from datetime import datetime
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
|
||||
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union, Sequence
|
||||
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.utils.safestring import SafeText
|
||||
@@ -18,7 +18,9 @@ class ErrorDict(dict):
|
||||
class ErrorList(UserList):
|
||||
data: List[Union[ValidationError, str]]
|
||||
error_class: str = ...
|
||||
def __init__(self, initlist: Optional[ErrorList] = ..., error_class: Optional[str] = ...) -> None: ...
|
||||
def __init__(
|
||||
self, initlist: Optional[Union[ErrorList, Sequence[str]]] = ..., error_class: Optional[str] = ...
|
||||
) -> None: ...
|
||||
def as_data(self) -> List[ValidationError]: ...
|
||||
def get_json_data(self, escape_html: bool = ...) -> List[Dict[str, str]]: ...
|
||||
def as_json(self, escape_html: bool = ...) -> str: ...
|
||||
|
||||
Reference in New Issue
Block a user