Commit Graph

554 Commits

Author SHA1 Message Date
Maxim Kurnikov
03b59b872d cleanups, fallback to Any in some corner cases 2019-07-24 13:38:49 +03:00
Maxim Kurnikov
0e72b2e6fc more values(), values_list() cases 2019-07-24 13:38:49 +03:00
Maxim Kurnikov
b81fbdeaa9 remove -semanal suffix 2019-07-24 13:38:49 +03:00
Maxim Kurnikov
dc6101b569 remove old semanal plugin data 2019-07-24 13:38:49 +03:00
Maxim Kurnikov
d53121baae add support for forms, values, values_list 2019-07-24 13:38:49 +03:00
Maxim Kurnikov
3c3122a93f add settings support 2019-07-24 13:38:49 +03:00
Maxim Kurnikov
7b1b1b6bfe add related managers support 2019-07-24 13:38:49 +03:00
Maxim Kurnikov
2cb1f257eb add proper __init__, create() support 2019-07-24 13:38:49 +03:00
Maxim Kurnikov
b11a9a85f9 new semanal wip 1 2019-07-24 13:38:49 +03:00
Maxim Kurnikov
9c5a6be9a7 split helpers into smaller files 2019-07-24 13:38:49 +03:00
Maxim Kurnikov
a9c1bcbbc6 Merge pull request #111 from rik/has_perm
More accurate `PermissionsMixin.has_perm`
2019-07-21 19:23:18 +03:00
Anthony Ricaud
f365297baf Allow any Collection to be passed to has_perms 2019-07-21 02:09:05 +01:00
Anthony Ricaud
6859ec94b6 More accurate PermissionsMixin.has_perm
It only accepts `str` for `perm`
2019-07-19 12:42:03 +01:00
Maxim Kurnikov
335c5765c3 enable test folders: select_for_update, i18n, httpwrappers, auth_tests, extra_regress (#107) 2019-07-10 19:38:36 +03:00
Maxim Kurnikov
b397ec04a9 add utils_tests test folder to typechecking (#106) 2019-07-10 18:19:37 +03:00
Nikita Sobolev
f7db296e8b Makes localtime/localdate accept optional params (#105)
* Makes localtime/localdate accept optional params

Closes #104

* Removed None from default values
2019-07-10 15:58:10 +03:00
Maxim Kurnikov
2f6af159f7 add correct return annotation to get_storage_class (#103)
Co-Authored-By: cs-cordero <chris.s.cordero@gmail.com>
2019-07-10 14:06:09 +03:00
Maxim Kurnikov
2799646723 add missing files throughout the codebase (#102) 2019-07-09 05:18:15 +03:00
Maxim Kurnikov
d8230a4147 Add typechecking for 'file_storage', 'files' test folders (#101)
* add typechecking for 'file_storage', 'files' test folders

* fix File class annotations
2019-07-07 03:58:00 +03:00
Peter Law
861c6653fd Make SuccessMessageMixin fully compatible with FormMixin (#86)
This ensures that the order in which these mixins are included
into a derrived class does not matter and ends up more accurately
reflecting the return type of SuccessMessageMixin in the process
(its code doesn't appear to enforce that the returned response
is a redirect).

This provides a fix to a secondary aspect of
https://github.com/mkurnikov/django-stubs/issues/79.
2019-07-02 13:34:05 +03:00
Konstantin Alekseev
db7b46589f Add timezone.localdate() (#87) 2019-07-02 13:33:28 +03:00
Maxim Kurnikov
90cab6c5bf revert meta: Options annotation (#99) 2019-07-01 22:33:00 +03:00
Peter Law
25165de80f Add get_candidate_relations_to_delete (#92)
* Set a precise type for Model._meta

* Add missing 'get_candidate_relations_to_delete' function signature

Fixes https://github.com/mkurnikov/django-stubs/issues/77.
2019-07-01 18:50:01 +03:00
Peter Law
2295b14214 Allow any iterable to be passed to method_decorator (#90)
From reading the source of Django 2.1.9, this seems to be what's
allowed there.

Fixes https://github.com/mkurnikov/django-stubs/issues/78.
2019-07-01 18:49:40 +03:00
Maxim Kurnikov
a77d5b27d8 Update typecheck_tests to django 2.2 branch, remove unused ignores (#98)
* update typecheck_tests to django 2.2 branch, remove unused ignores

* lint fixes
2019-07-01 18:44:34 +03:00
Maxim Kurnikov
4e1c32f6a3 Fix mypy==0.710 errors (#97)
* error -> note for revealed type for tests

* fixes for latest mypy
2019-07-01 00:51:56 +03:00
Maxim Kurnikov
ea1294bd30 set version to 0.13.0, bump mypy to 0.710 2019-07-01 00:02:41 +03:00
Maxim Kurnikov
79d691732d do not release if uncommitted changes 2019-07-01 00:02:41 +03:00
Anton Agestam
629ba954b4 fix: remove SuccessMessageMixin.form_valid violation of Liskov substitution principle (#84) 2019-06-02 13:23:37 +03:00
Ran Benita
0e60b70ae4 A couple of small fixes (#81)
* Fix type of django.contrib.postgres.fields.JSONField(verbose_name)

* Improve type for CursorWrapper.execute(params)

Not perfect. Based on simple cases from
http://initd.org/psycopg/docs/usage.html#adaptation-of-python-values-to-sql-types
2019-05-21 21:26:45 +03:00
Ville Skyttä
dd5b98faf0 django.contrib.messages.api: use HttpRequest instead of WSGIRequest (#73)
Its error messages explicitly note that an HttpRequest is required.
https://docs.djangoproject.com/en/2.1/_modules/django/contrib/messages/api/#add_message
2019-05-21 17:23:19 +03:00
Ethan Smith
e634a5d460 Re-export names from django.core.cache.backend.base (#71) 2019-05-19 19:59:14 +03:00
aszlig
d7d7e6c66e Fix type of prefix arg in staticfiles_urlpatterns (#74)
Using a *type* of None for the prefix keyword argument is not going to
typecheck very well, so it might be a typo here because the default
value (rather than the type) is None.

Signed-off-by: aszlig <aszlig@nix.build>
2019-05-19 19:59:00 +03:00
Anthony Ricaud
b66727657d Type non-parametrised views.decorators.http (#80)
Fixes `error: Untyped decorator makes function "view" untyped`
2019-05-17 20:40:40 +03:00
Maxim Kurnikov
86642e3ddd bump version v0.12.1 2019-04-15 14:50:43 +03:00
Maciej Gol
952e1c3ee9 Preserve callable type in view decorators (#67) 2019-04-13 22:31:49 +03:00
Maxim Kurnikov
5dd6eccdb5 make ignore_missing_model_attributes behaviour optional (#66)
make "ignore_missing_model_attributes" behaviour opt-in
v0.12.0
2019-04-12 17:22:18 +03:00
Maxim Kurnikov
fd06816cbb Work around "no settings module" crash (#65)
Workaround "no settings module" crash
2019-04-12 17:14:23 +03:00
Maxim Kurnikov
aeb435c8b3 Disable monkeypatches, add dependencies via new hook (#60)
* code cleanups, disable monkeypatches, move to add_additional_deps

* disable incremental mode for tests

* add pip-wheel-metadata

* move some code from get_base_hook to get_attribute_hook to reduce dependencies

* simplify values/values_list tests and code

* disable cache for some tests failing with incremental mode

* enable incremental mode for tests typechecking

* pin mypy version

* fix tests

* lint

* fix internal crashes
2019-04-12 14:54:00 +03:00
Maxim Kurnikov
13d19017b7 bump version v0.11.1 2019-04-01 19:40:13 +03:00
Maxim Kurnikov
28a3f126ee make mypy.checker import locally to prevent import cycles 2019-04-01 19:39:50 +03:00
Maxim Kurnikov
304cb19de6 really drop universal v0.11.0 2019-04-01 01:43:14 +03:00
Maxim Kurnikov
c57f4f7152 only python3.6+ are supported 2019-04-01 01:08:46 +03:00
Maxim Kurnikov
8a826fee1e bump version 2019-04-01 00:54:36 +03:00
Maxim Kurnikov
37d85c2ca6 pin mypy version, django-stubs not yet supports mypyc 2019-04-01 00:54:15 +03:00
Seth Yastrov
71fb0432f3 52/model subtypes dont typecheck (#55)
* Fix problem where Model instancess are not considered subtypes of each other due to fallback_to_any = True. Fixes #52.

- Added a stub for __getstate__ to Model.
- Added a stub for clean() to Model.
- Correct arg type for sort_dependencies so they are covariant (Iterable rather than List).

Test ignores:
- Added some test ignores in cases where a model inherits from 2 different base models.
- Added some test ignores for cases that MyPy flags as errors due to variable redefinitions or imports that are incompatible types.

* Address review comment.
2019-03-28 23:13:02 +03:00
Maxim Kurnikov
9288c34648 fix @classproperty return type (#58) 2019-03-27 23:13:10 +03:00
Maxim Kurnikov
70050f28b9 drop --universal 2019-03-26 03:23:25 +03:00
Maxim Kurnikov
4338c17970 bump version 2019-03-25 14:22:17 +03:00
Maxim Kurnikov
91f789c38c fix SessionBase.exists() return type (#57) 2019-03-25 14:21:12 +03:00