Commit Graph

487 Commits

Author SHA1 Message Date
Ran Benita
58b26fdbd3 Improve TestCase.assertNumQueries type (#250) 2019-12-10 19:37:13 +03:00
Youssef Moussaoui
9ca79c24a2 Move BLANK_CHOICE to django.db.models.fields (#242) 2019-12-08 08:19:24 +03:00
Maxim Kurnikov
540e28f4c6 bump version to 1.3.0 v1.3.0 2019-12-06 23:37:19 +03:00
Maksim Kurnikov
4ac43c6ed6 Add Django 3.0 testing to CI (#246)
* add Django 3.0 testing to CI

* remove importlib_metadata usage

* conditionally load choices module for tests
2019-12-06 23:36:24 +03:00
Maksim Kurnikov
cadd6c963b fix model's on_cascade= parameter for test, update to latest gdal (#247) 2019-12-06 03:40:55 +03:00
Konstantin Alekseev
041754f817 Fix smtp backend open (#240) 2019-12-01 20:46:11 +03:00
Konstantin Alekseev
c0c5d1e588 Cleanup EmailMessage types (#208)
* Cleanup EmailMessage types

* Typecheck email module tests.
2019-12-01 17:14:16 +03:00
Maksim Kurnikov
f824003cc4 remove unused ignore pattern (#239) 2019-12-01 00:09:36 +03:00
Youssef Moussaoui
58f1833cab Declare is_relation and related_model on Field (#230) 2019-11-30 22:40:22 +03:00
Maksim Kurnikov
cbb6a7a9ac Merge pull request #238 from mkurnikov/mypy-750
Mypy 0.750 support
2019-11-30 22:27:50 +03:00
Maxim Kurnikov
2c4827bbaf properly change type of self for methods on custom manager classes 2019-11-30 22:08:16 +03:00
Maxim Kurnikov
5a151bf851 update django tests branch 2019-11-30 20:56:31 +03:00
Konstantin Alekseev
cbc7159995 Support mypy 0.750 2019-11-30 13:39:28 +03:00
Patrick Gingras
df4c17a947 added base_fields and declared_fields properties to Form (#235) 2019-11-27 22:48:05 +03:00
yaegassy
445abc046c README.md Fix: sample code for "Notes" (#234) 2019-11-26 15:40:21 +03:00
Anthony Ricaud
557b7a4fa3 Add new View.setup method introduced in Django 2.2 (#233)
https://docs.djangoproject.com/en/2.2/ref/class-based-views/base/#django.views.generic.base.View.setup
https://github.com/django/django/blob/2.2/django/views/generic/base.py#L83-L87
2019-11-20 23:49:38 +03:00
Maksim Kurnikov
8343d76895 Fix has_perm() methods for auth backend, and for contrib.auth.models (#232)
* fix has_perm() methods

* lint
2019-11-19 04:54:17 +03:00
Maksim Kurnikov
8d986a0f43 remove catch-all __getattr__ for Manager, fix some issues with manager methods (#227) 2019-11-12 20:36:07 +03:00
Pilifer
e9a90ebff0 More precise annotations of utils.timezone functions that return instances of tzinfo subclasses. (#209)
* fix annotations of utils.timezone

* use intermediary tzinfo subclass exposed in pytz typeshed

* fix annotations of get_fixed_timezone as it returns datetime.timezone in Django 2.2

* add explanatory comment to get_current_timezone annotations

* black utils.timezone.pyi
2019-11-12 18:27:54 +03:00
Christopher Sabater Cordero
7b74a6944a Add a few missing types to the stubfiles (#214)
* Add types to stub files.

* Fix black and flake8 errors.
2019-11-12 18:25:31 +03:00
Seth Yastrov
83f11a0fc6 Add Tags.translation to stub (#226) 2019-11-12 18:23:29 +03:00
Seth Yastrov
2829faf1af Both CSRF_COOKIE_SAMESITE and SESSION_COOKIE_SAMESITE should be Optional (#216) 2019-11-12 16:13:16 +03:00
src
d061e84cc7 Add HttpResponsePermanentRedirect to django.shortcuts (#211) 2019-11-12 16:12:36 +03:00
Anna Sidwell
3a9263dc62 Two small improvements (#217)
* Add return type for admin.SimpleListFilter.lookups

* force_login() can take any user, not just builtin
2019-11-12 13:31:24 +03:00
Yngve Høiseth
14aea2b4d4 Allow returning bool from test_func (#220) 2019-11-12 05:52:23 +03:00
Maksim Kurnikov
287c64d6fb Pin to 0.740 and fix CI (#225)
* update django sources

* pin mypy version, update to 0.740

* fix tests typechecking

* fix lint
2019-11-12 05:17:36 +03:00
Nikita Sobolev
6601121db2 Fixes travis url 2019-10-21 23:47:06 +03:00
Andrey
87d59c7c1a Fix django.contrib.admin.options.BaseModelAdmin.has_add_permission (#205)
* Fix `django.contrib.admin.options.BaseModelAdmin.has_add_permission` (#203).

* Add `django.db.models.base.Model.unique_error_message` (#204).
2019-10-11 12:16:21 +03:00
Maxim Kurnikov
8402e7c53e improve annotations in some places (#202)
* improve annotations in some places

* linting
2019-10-07 14:50:45 +03:00
Maxim Kurnikov
dceb075152 fix annotation for BaseCommand.handle() (#201) v1.2.0 2019-10-05 21:36:41 +03:00
Maxim Kurnikov
7e3f4bfa02 Fix ForeignKey type for self-reference defined in the abstract model (#200) 2019-10-05 21:36:29 +03:00
Maxim Kurnikov
db9ff6aaf6 Fix crash if model from same app referenced in RelatedField cannot be resolved (#199)
* do not crash if model from same app refd in ForeignKey cannot be resolved

* bump to 1.2.0
2019-10-05 20:00:51 +03:00
Maxim Kurnikov
717be5940f Reorganize code a bit, add current directory to sys.path (#198)
* reorganize code a bit

* add current directory to sys.path

* remove PYTHONPATH mention from the docs

* linting
2019-10-05 19:44:29 +03:00
Nikita Sobolev
b939bc96b7 Improves README with new example repo, python version matrix (#195) 2019-10-01 15:24:48 +03:00
Maxim Kurnikov
02bdf5be95 add support for typechecking of filter/get/exclude arguments (#183)
* add support for typechecking of filter/get/exclude arguments

* linting
2019-09-30 03:05:40 +03:00
Maxim Kurnikov
4d4b0003bd Fix Paginator properties mistyped as Callables (#193)
Co-authored-by: Nick Sweeting <git@sweeting.me>
2019-09-28 22:16:20 +03:00
Maxim Kurnikov
e143ba568c add mypy compatibility table (#190)
* add mypy compatibility table

* add django versions to compatibility table
2019-09-28 22:14:16 +03:00
Maxim Kurnikov
32c0cbca45 add some diagnostic for unused ignores for tests typechecking (#191) 2019-09-28 21:38:56 +03:00
Anthony Ricaud
acc3ca4205 Contexts can contain Any data (#192) 2019-09-28 21:38:04 +03:00
Maxim Kurnikov
be3fc259d5 fix compatibility with 0.730 (#189) 2019-09-28 05:23:55 +03:00
Maxim Kurnikov
7725b416b6 add unused ignores reporting (#188) 2019-09-28 04:48:44 +03:00
Maxim Kurnikov
2c23d8e70f Use runtime information to determine whether class is a models.Model subclass (#182) 2019-09-28 04:05:54 +03:00
Anthony Ricaud
5910bd1b25 resolve_template accepts Sequences of str (#187)
- resolve_template is checking for lists or tuples so let's use a generic Sequence
- Union[Template, Template] seemed redundant
2019-09-25 23:32:23 +03:00
Maxim Kurnikov
963d50c717 add linting stubs with flake8-pyi and check for unused imports (#186) 2019-09-25 02:20:23 +03:00
Maxim Kurnikov
7407b93151 Fix type annotations for django.utils.safestring (#179)
* Add/fix types for django.utils.safestring.mark_safe

Django code ref: 964dd4f4f2/django/utils/safestring.py (L71-L84)

* add generic annotations for mark_safe, remove SafeBytes as it is basically deprecated

Co-authored-by: Daniel Hahler <github@thequod.de>
2019-09-23 21:17:17 +03:00
Daniel Hahler
afcd0d9293 Bump isort, use --diff (#164)
* dev-requirements: bump isort: 4.3.4 => 4.3.21

* isort: use --diff

* known_first_party = mypy_django_plugin

* Run isort
2019-09-23 20:45:43 +03:00
Maxim Kurnikov
a85dbff793 update import_all test, add some stubs for postgres (#178) 2019-09-23 19:47:11 +03:00
Maxim Kurnikov
68aebe2528 Add django.contrib.gis.db.models and django.contrib.gis.db.models.fields (#177)
* add django.contrib.gis.db.models and django.contrib.gis.db.models.fields

* install gdal in ci

* add sudo to apt

* add apt update
2019-09-23 19:30:32 +03:00
Peter Law
d3dca5b408 related_name is Optional[str] (#176)
In the current Django (2.1, 2.2), the `related_name` parameter to
`OneToOneField` and `ForeignKey` classes (much like `ManyToManyField`
and the base `ForeignObject` classes) is `Optional[str]`. While
it's true that most authors won't pass `None` here, derived field
types will want to be able to do so.
2019-09-23 17:38:34 +03:00
Peter Law
c69090ec5b Options.verbose_name_raw is always a string (#175)
At least in the current implementation.
2019-09-21 16:07:55 +03:00