38 Commits
Author SHA1 Message Date
Adam JohnsonandNikita Sobolev 1d78b8ffac Add SQLite backend is_in_memory_db() functions (#1218)
* Add SQLite backend is_in_memory_db() functions

* Update django-stubs/db/backends/sqlite3/creation.pyi

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-11-03 16:18:05 +03:00
Adam Johnson 0381fdb022 Add some types to views (#1221)
* Add some types to views

* Remove GeoModelAdmin.formfield_for_dbfield
2022-10-31 20:43:49 +03:00
Adam Johnson f566734799 Re-allow expressions in UniqueConstraint (#1220) 2022-10-31 15:11:07 +03:00
Adam Johnson 2a17d3f08f Remove bad redirect_chain attributes (#1148) 2022-10-31 14:35:45 +03:00
Adam JohnsonandSimon Kohlmeyer 7bce5c2081 BaseDeleteView now extends FormMixin (#1215)
* BaseDeleteView now extends FormMixin

Co-Authored-By: Simon Kohlmeyer <simon.kohlmeyer@gmail.com>

* With Generic

Co-authored-by: Simon Kohlmeyer <simon.kohlmeyer@gmail.com>
2022-10-28 23:36:38 +03:00
Adam JohnsonandRyan Vinzent e20d5307d1 Add BaseDatabaseSchemaEditor.table_sql() (#1212)
Co-Authored-By: Ryan Vinzent <ryan.vinzent@invitae.com>

Co-authored-by: Ryan Vinzent <ryan.vinzent@invitae.com>
2022-10-27 21:32:50 +03:00
Adam Johnson ae5af12c9b Add BaseDetailView.object (#1211) 2022-10-27 21:32:08 +03:00
Adam Johnson 85ae4bb704 Add django.db.models.base.model_unpickle (#1209) 2022-10-27 21:30:44 +03:00
Adam JohnsonandBen Nace efebe22397 Add auto_now attrs to date and time model fields (#1210)
Co-Authored-By: Ben Nace <ben2701@verizon.net>

Co-authored-by: Ben Nace <ben2701@verizon.net>
2022-10-27 20:52:48 +03:00
Adam Johnson 36002a2087 Standardize all context manager __exit__ methods (#1194) 2022-10-19 10:31:38 +01:00
Adam Johnson 54e75fbe74 Update cache timeout parameters to floats (#1193) 2022-10-19 10:31:29 +01:00
Adam Johnson 29e2b65c8b Improve Flake8 config (#1149) 2022-09-09 17:16:22 +03:00
Adam Johnson 3c942483d4 Correct EmailMultiAlternatives.body (#1146) 2022-09-08 14:13:54 +03:00
Adam Johnson 74e31c7562 Add QuerySet.__aiter__() (#1136) 2022-08-28 15:15:28 +03:00
Adam Johnson 0635afa57c Fix Manager.contains and bulk_create (#1135) 2022-08-28 12:01:40 +03:00
Adam Johnson 3622a61442 Improve types for QuerySet.contains and bulk_create (#1134)
* Improve types for QuerySet.contains and bulk_create

* models.Model
2022-08-28 11:37:37 +03:00
Adam Johnson bfad3b05c1 Improve database backend types (#1132)
* Improve database backend types

* fixes
2022-08-28 11:15:22 +03:00
Adam Johnson 11c587867d Add Q.__xor__ (#1133) 2022-08-28 11:14:03 +03:00
Adam Johnson a01ab43cc6 Add HttpRequest current_app and LANGUAGE_CODE attrs (#1127)
* Add HttpRequest.current_app

* rearrange and add LANGUAGE_CODE
2022-08-26 17:23:50 +03:00
Adam Johnson 82695e8e1c Add db Field.flatchoices (#1128)
* Add db Field.flatchoices

* @property
2022-08-26 17:23:26 +03:00
Adam Johnson 0120fc531a Rewrite SessionBase properties to use @property (#1129) 2022-08-26 17:22:03 +03:00
Adam JohnsonandNikita Sobolev de3e13ad92 Add database Field.non_db_attrs (#1125)
* Add database Field.non_db_attrs

* Update django-stubs/db/models/fields/__init__.pyi

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-08-26 14:56:56 +03:00
Adam Johnson 63bee32d0d Add different signatures for form assertions from Django 4.1 (#1105) 2022-08-26 13:31:45 +03:00
Adam Johnson 1a310ef7f9 Add test client response.redirect_chain (#1124) 2022-08-26 13:31:17 +03:00
Adam Johnson 8b5509b2ab Improve type hints for test client response.context (#1100)
* Improve type hints for test client response.context

* fix test
2022-08-26 13:30:18 +03:00
Adam Johnson d2bfd3710b Improve return type for BaseCommand.execute() (#1104) 2022-08-26 13:10:24 +03:00
Adam JohnsonandNikita Sobolev cf16720f28 Improve types for DiscoverRunner (#1106)
* Improve types for DiscoverRunner

* add types for class-level attrs

* Add extra methods

* Add PDBDebugResult class

* black

* Update django-stubs/test/runner.pyi

* fix load_with_patterns return

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-08-26 13:09:41 +03:00
Adam Johnson 063a35f4d0 Expose HttpResponseBase in django.http (#1121)
* Expose HttpResponseBase in django.http

* isort
2022-08-26 12:45:22 +03:00
Adam Johnson 9ba4a55c93 Improve types for CheckMessage subclasses (#1107) 2022-08-26 12:44:18 +03:00
Adam Johnson 561140a584 Allow None to be passed to Paginator.get_page (#1101) 2022-08-26 12:40:53 +03:00
Adam Johnson 5b705d25da Add SimpleTestCase.assertURLEqual() (#1102) 2022-08-26 12:40:34 +03:00
Adam Johnson f626448105 Add BaseDatabaseWrapper.operations (#1119) 2022-08-26 12:40:17 +03:00
Adam Johnson 63ea17744f Add HttpResponseBase.__contains__ (#1099) 2022-08-26 12:37:23 +03:00
Adam Johnson f8fca3f94f Improve hints for BaseCache (#1117)
* Improve hints for BaseCache

* fix syntax error
2022-08-26 12:36:58 +03:00
Adam Johnson efc2d04ead Improve types for @require_http_methods (#1075) 2022-07-26 20:47:05 +03:00
Adam Johnson ae5b1a4edf Improve admin filter lookups() return type (#992) 2022-06-13 18:45:55 +03:00
Adam Johnson 13c09921f8 Improve admin filter types (#984) 2022-06-07 12:29:44 +03:00
Adam Johnson eb6991b008 Improve forms stubs (#862)
* `default_renderer` may be a renderer class, instance, or `None`: https://docs.djangoproject.com/en/4.0/ref/forms/api/#django.forms.Form.default_renderer
* `field_order` should be a list/sequence of field names, or `None`: https://docs.djangoproject.com/en/4.0/ref/forms/api/#django.forms.Form.field_order
* `cleaned_data` should be a dict/mapping of field names to values, as returned by `clean()`: https://docs.djangoproject.com/en/4.0/ref/forms/api/#django.forms.Form.cleaned_data . I similarly updated `clean()` to allow arbitrary mappings, since it may be legitimate to use some special mapping class.
* `clean()` does not need to return a mapping - https://docs.djangoproject.com/en/4.0/ref/forms/validation/#validating-fields-with-clean : “If your form inherits another that doesn’t return a `cleaned_data` dictionary in its `clean()` method (doing so is optional)...”
* `is_multipart` returns a `bool`: https://docs.djangoproject.com/en/4.0/ref/forms/api/#django.forms.Form.is_multipart
* `hidden_fields` and `visible_fields` aren't documented, but they return lists of `BoundField` instances: https://github.com/django/django/blob/d8b437b1fbe3bf54822833bea5e19d2142cf3e1f/django/forms/forms.py#L501-L513
2022-03-02 18:02:54 +03:00