mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-18 01:45:59 +08:00
* Adds more rules to mypy config, related #662 * Removes plugin.ini for mypy settings * Fixes build
This commit is contained in:
@@ -70,7 +70,7 @@ class PermissionsMixin(models.Model):
|
||||
def has_perms(self, perm_list: Collection[str], obj: Optional[_AnyUser] = ...) -> bool: ...
|
||||
def has_module_perms(self, app_label: str) -> bool: ...
|
||||
|
||||
class AbstractUser(AbstractBaseUser, PermissionsMixin): # type: ignore
|
||||
class AbstractUser(AbstractBaseUser, PermissionsMixin):
|
||||
username_validator: UnicodeUsernameValidator = ...
|
||||
|
||||
username = models.CharField(max_length=150)
|
||||
|
||||
@@ -2,7 +2,7 @@ from typing import Any
|
||||
|
||||
from django.db import models
|
||||
|
||||
from psycopg2.extras import DateRange, DateTimeTZRange, NumericRange # type: ignore
|
||||
from psycopg2.extras import DateRange, DateTimeTZRange, NumericRange
|
||||
|
||||
class RangeField(models.Field):
|
||||
empty_strings_allowed: bool = ...
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
from django.core.management.commands.runserver import Command as RunserverCommand # type: ignore
|
||||
from django.core.management.commands.runserver import Command as RunserverCommand
|
||||
|
||||
class Command(RunserverCommand): ...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from email._policybase import Policy # type: ignore
|
||||
from email._policybase import Policy
|
||||
from email.message import Message
|
||||
from email.mime.base import MIMEBase
|
||||
from email.mime.message import MIMEMessage
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from django.core.serializers import base as base
|
||||
from typing import Any
|
||||
from xml.sax.expatreader import ExpatParser as _ExpatParser # type: ignore
|
||||
from xml.sax.expatreader import ExpatParser as _ExpatParser
|
||||
|
||||
class Serializer(base.Serializer):
|
||||
def indent(self, level: Any) -> None: ...
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import types
|
||||
from datetime import date, datetime, time
|
||||
from decimal import Decimal
|
||||
from typing import Any, ContextManager, Dict, List, Mapping, Optional, Sequence, Tuple, Type, Union
|
||||
from typing import Any, ContextManager, Dict, List, Mapping, Optional, Sequence, Tuple, Type, Union, Iterator
|
||||
from uuid import UUID
|
||||
|
||||
logger: Any
|
||||
|
||||
@@ -94,16 +94,16 @@ class Client(RequestFactory):
|
||||
def request(self, **request: Any) -> HttpResponse: ... # type: ignore
|
||||
def get( # type: ignore
|
||||
self, path: str, data: Any = ..., follow: bool = ..., secure: bool = ..., **extra: Any
|
||||
) -> HttpResponse: ... # type: ignore
|
||||
) -> HttpResponse: ...
|
||||
def post( # type: ignore
|
||||
self, path: str, data: Any = ..., content_type: str = ..., follow: bool = ..., secure: bool = ..., **extra: Any
|
||||
) -> HttpResponse: ... # type: ignore
|
||||
) -> HttpResponse: ...
|
||||
def head( # type: ignore
|
||||
self, path: str, data: Any = ..., follow: bool = ..., secure: bool = ..., **extra: Any
|
||||
) -> HttpResponse: ... # type: ignore
|
||||
) -> HttpResponse: ...
|
||||
def trace( # type: ignore
|
||||
self, path: str, follow: bool = ..., secure: bool = ..., **extra: Any
|
||||
) -> HttpResponse: ... # type: ignore
|
||||
) -> HttpResponse: ...
|
||||
def options( # type: ignore
|
||||
self,
|
||||
path: str,
|
||||
@@ -112,16 +112,16 @@ class Client(RequestFactory):
|
||||
follow: bool = ...,
|
||||
secure: bool = ...,
|
||||
**extra: Any
|
||||
) -> HttpResponse: ... # type: ignore
|
||||
) -> HttpResponse: ...
|
||||
def put( # type: ignore
|
||||
self, path: str, data: Any = ..., content_type: str = ..., follow: bool = ..., secure: bool = ..., **extra: Any
|
||||
) -> HttpResponse: ... # type: ignore
|
||||
) -> HttpResponse: ...
|
||||
def patch( # type: ignore
|
||||
self, path: str, data: Any = ..., content_type: str = ..., follow: bool = ..., secure: bool = ..., **extra: Any
|
||||
) -> HttpResponse: ... # type: ignore
|
||||
) -> HttpResponse: ...
|
||||
def delete( # type: ignore
|
||||
self, path: str, data: Any = ..., content_type: str = ..., follow: bool = ..., secure: bool = ..., **extra: Any
|
||||
) -> HttpResponse: ... # type: ignore
|
||||
) -> HttpResponse: ...
|
||||
def store_exc_info(self, **kwargs: Any) -> None: ...
|
||||
@property
|
||||
def session(self) -> SessionBase: ...
|
||||
|
||||
Reference in New Issue
Block a user