* run black
* create monkeypatching function for adding get_item dunder
* whoops i forgot the test
* change the name in INSTALLED_APPS to make test pass
* turn the whole thing into a proper package
* move django_stubs_ext to requirements.txt
* also install requirements.txt
* attempt to fix pre-commit
* numerous small code review fixes
* fix dependency issues
* small dependency fixes
* configure proper license file location
* add the rest of the monkeypatching
* use strict mypy
* update contributing with a note monkeypatching generics
* copy release script from parent package
* Add stubs for remaining commands in django.core.management.commands
* Tighten up stub definitions in django.core.management.commands
* Apply some missing declarations in django.core.management.commands
* change get_user to use a protocol requiring a session
define a "_HasSession" protocol, and update contrib.auth.get_user to use it
get_user only requires a session field, and idiomatic django testing frequently calls get_user with a TestClient
* run black
* use union for get_user instead of a protocol
* create tests for get_user typechecking
* properly import test client
* Add `is_active` field to `django.contrib.auth.AbstractBaseUser` model
* Favor defining type than setting concrete value
* Update type to reflect sub-class implementation
This also corrects the fact that "run_checks" only returns a concatenated list
of all registered check results, which may only contain CheckMessage:
302caa40e4/django/core/checks/registry.py (L60)
The Django API requires that registered checks take an "app_configs"
argument, which is a list of AppConfig. This is practically also passed by
keyword, so all parameters should be specified with a "= ..." to indicate
that they are keywords.
Django always passed "app_configs" as a list, but checks can accept and
use a more general more Sequence.
The Django API also requires that registered checks take "**kwargs".
This results in the canonical parameters of:
"app_configs: Optional[Sequence[AppConfig]] = ..., **kwargs: Any"
* make BaseModelAdmin generic to properly type the `obj` argument of ModelAdmin.delete_model
closes#482
* turn BaseModelAdmin into bound generic, run black
* add test for generic ModelAdmin
* Allow overridable checks to be CheckMessage
The checks framework expects return types to be "List[CheckMessage]". This
allows all overridable checks-returning methods to return the more general
"CheckMessage", instead of the "Error" subclass.
* Ignore an incorrect usage of the checks API in Django 2.2