Skip to content

A couple of small fixes #81

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

Merged
merged 2 commits into from
May 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion django-stubs/contrib/postgres/fields/jsonb.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ class JSONField(CheckFieldDefaultMixin, Field):
default_error_messages: Any = ...
encoder: Any = ...
def __init__(
self, verbose_name: None = ..., name: None = ..., encoder: Optional[Type[JSONEncoder]] = ..., **kwargs: Any
self,
verbose_name: Optional[str] = ...,
name: Optional[str] = ...,
encoder: Optional[Type[JSONEncoder]] = ...,
**kwargs: Any
) -> None: ...
def db_type(self, connection: Any): ...
def deconstruct(self) -> Tuple[None, str, List[Any], Dict[str, Union[Type[JSONEncoder], bool]]]: ...
Expand Down
10 changes: 7 additions & 3 deletions django-stubs/db/backends/utils.pyi
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
from datetime import date, datetime, time
from decimal import Decimal
from typing import Any, Dict, Iterator, List, Optional, Tuple, Union
from typing import Any, Dict, Iterator, List, Mapping, Optional, Sequence, Tuple, Union
from uuid import UUID

logger: Any

# Python types that can be adapted to SQL.
_SQLType = Union[None, bool, int, float, Decimal, str, bytes, datetime, UUID]

class CursorWrapper:
cursor: Any = ...
db: Any = ...
Expand All @@ -15,10 +19,10 @@ class CursorWrapper:
def __exit__(self, type: None, value: None, traceback: None) -> None: ...
def callproc(self, procname: str, params: List[Any] = ..., kparams: Dict[str, int] = ...) -> Any: ...
def execute(
self, sql: str, params: Optional[Union[List[bool], List[datetime], List[float], Tuple]] = ...
self, sql: str, params: Optional[Union[Sequence[_SQLType], Mapping[str, _SQLType]]] = ...
) -> Optional[Any]: ...
def executemany(
self, sql: str, param_list: Union[Iterator[Any], List[Tuple[Union[int, str]]]]
self, sql: str, param_list: Sequence[Optional[Union[Sequence[_SQLType], Mapping[str, _SQLType]]]]
) -> Optional[Any]: ...

class CursorDebugWrapper(CursorWrapper):
Expand Down