Releases: typeddjango/django-stubs
Releases ยท typeddjango/django-stubs
5.2.7
5.2.6
What's Changed
Improvements
- Update
add_ordering
signature too by @UnknownPlatypus in #2822 - Support
related_query_name
inModel._meta.get_fields
by @UnknownPlatypus in #2821 - django.urls.resolve can also take _StrPromise by @asottile in #2826
- Add
strict_model_abstract_attrs
setting to allowmodels.Model.objects
access by @sobolevn in #2830 - Refactor
_replace_type_var
that can potentially cause cache problems by @sobolevn in #2834 - Fix
union
/intersection
/difference
to support QuerySet usingvalues_list
andvalues
by @UnknownPlatypus in #2829 - fix: allow to query decimal fields with int by @sk- in #2838
- Fix the
log_action
deprecation notice by @UnknownPlatypus in #2839 - BaseForm.add_error: Use covariant types by @inducer in #2849
- Allow to annotate existing model field de-selected via prior
.values
/.values_list
calls by @UnknownPlatypus in #2836 - Support
GenericPrefetch
by @UnknownPlatypus in #2851 - Also typecheck
aget
calls by @UnknownPlatypus in #2856 - Validation of the
fields
argument tobulk_update
by @UnknownPlatypus in #2808
Housekeeping & CI
- Add
mypy_primer
workflow by @sobolevn in #2819 - Remove magically added
django.contrib.contenttypes
installed app in tests by @UnknownPlatypus in #2853 - Use consistent indentation in
pyproject.toml
by @intgr in #2847 - Version 5.2.6 release by @intgr in #2859
Ruff
- Bump
ruff
to0.13.0
by @sobolevn in #2828 - Add some RET plugin ruff rules by @UnknownPlatypus in #2852
- Enable more ruff rules by @UnknownPlatypus in #2855
- Fix merge conflict + re-run pre-commit on all files by @UnknownPlatypus in #2854
uv
package manager
- Update release documentation, workflow and build-and-check job to
uv
by @intgr in #2846 - Switch to
uv_build
build system & cleanup by @intgr in #2848 - Use same
uv
workspace fordjango-stubs-ext
also by @intgr in #2857 - Test updated release workflow - Version 5.2.6a1 release by @intgr in #2858
New Contributors
Full Changelog: 5.2.5...5.2.6
5.2.6a1 (testing)
Testing updated release workflow.
Using alpha version in case anything goes wrong -- so users won't be updated automatically.
5.2.5
5.2.4
5.2.3
What's Changed
- Refine
Model._meta.get_field("field_name")
type inference by @UnknownPlatypus in #2748 - Adds check for too many positional arguments in
__init__
calls by @UnknownPlatypus in #2749 - Improve
settings.TEMPLATE
types by @UnknownPlatypus in #2741 - Change partition input to any iterable by @bewing in #2752
content_type_extra
containsbytes
, notstr
by @alexmv in #2754- Allow passing None to migrations.AlterOrderWithRespectTo by @niklasmohrin in #2759
- Annotate return type of
reverse_lazy()
by @pgcd in #2766 - Change
FormMixin.success_url
to_StrOrPromise
by @pgcd in #2769 - More lazy urls by @ngnpope in #2770
- Allow all error types to
BaseForm.add_error()
in documentation by @CarrotManMatt in #2774 - Remove
OrderedDict
usage, this is the default since py 3.6 by @UnknownPlatypus in #2780 - Simpler
get_current_module
util by @UnknownPlatypus in #2781 - Initial support for
to_attr
inferrence inPrefetch
calls by @UnknownPlatypus in #2779 - Reuse
get_class_init_argument_by_name
inresolve_many_to_many_arguments
by @UnknownPlatypus in #2782 - Simplify parsing of bool call arguments by @UnknownPlatypus in #2783
- Improve
Model
inference from customQuerySet
/Manager
by @UnknownPlatypus in #2784 - Declare
Prefetch
as generic and do specialization in the plugin by @UnknownPlatypus in #2786 - Update
Meta.permissions
type by @UnknownPlatypus in #2787 - Support star arg in
prefetch_related
calls by @UnknownPlatypus in #2789 - Auto inherit from
TypedModelMeta
by @UnknownPlatypus in #2788 - Improve
.select_related
stubs by @UnknownPlatypus in #2792 - Handle
.prefetch_related(..., to_attr="foo")
conflict with.annotate(foo=...)
by @UnknownPlatypus in #2791 - Detect invalid
to_attr
target (alredy defined fields) by @UnknownPlatypus in #2794 - Improve type for
order_by
/defer
/only
/distinct
/order_by
/explain
/dates
/datetimes
by @UnknownPlatypus in #2795 - Improve
prefetch_related
types with an overload by @UnknownPlatypus in #2793 - Detect more incompatible
to_attr
targets by @UnknownPlatypus in #2797 - Update django to 5.2.6 by @sobolevn in #2805
- Add lookup validation in prefetch related by @UnknownPlatypus in #2804
- Update mypy configuration by @ngnpope in #2799
- Validate
select_related
lookups by @UnknownPlatypus in #2806 - Bump mypy to 1.18.1 by @sobolevn in #2810
New Contributors
- @bewing made their first contribution in #2752
- @niklasmohrin made their first contribution in #2759
- @pgcd made their first contribution in #2766
- @CarrotManMatt made their first contribution in #2774
- @CodingWithSaksham made their first contribution in #2802
Full Changelog: 5.2.2...5.2.3
5.2.2
What's Changed
- Fix
reveal_type
to return its argument by @andersk in #2716 - fix stubs of HttpRequest read / readine by @asottile in #2714
- restore iterability of ResolverMatch by @asottile in #2719
- Add missing instance variable declarations for
RawQuerySet
by @youtux in #2718 - Add
join
toJSONObject
by @sobolevn in #2721 - add stubs for
QuerySet._raw_delete
by @asottile in #2733 - Fix aliasing of choices in a class in choices plugin by @ngnpope in #2734
- Change
resolve_callables
argument type toMapping
by @rodmk in #2735 - Update django to 5.2.4 by @sobolevn in #2736
- Fix test
HttpResponse.context_data
by @UnknownPlatypus in #2737 - Don't try to patch automatically symbols in
django.contrib.auth.forms
by @UnknownPlatypus in #2738 - Improve
.values()
types when expressions are used by @UnknownPlatypus in #2739 - Update mypy to 1.17.0 by @ngnpope in #2744
- Minor Plugin improvements by @UnknownPlatypus in #2745
BasePasswordHasher.safe_summary
commonly usesStrOrPromise
by @jdelic in #2742- Fix
FormMixin
plugin by @UnknownPlatypus in #2746
New Contributors
Full Changelog: 5.2.1...5.2.2
5.2.1
What's Changed
- Fix some
<type> is not present at runtime
errors by @UnknownPlatypus in #2635 - Fix missing at runtime errors (second batch) by @UnknownPlatypus in #2636
- Move method defined on
BaseManager
toManager
to follow runtime behavior by @UnknownPlatypus in #2637 - Fix missing at runtime errors (batch 3) by @UnknownPlatypus in #2639
- Add stubs for
django.template.autoreload
by @rafailmdzdv in #2638 - Allow permission methods to take any model instance as obj by @federicobond in #2640
- correct bound for
_UserType
by @asottile in #2645 - fix referencing
.value
of a Choices variable by @asottile in #2644 - Fixes to choices support in plugin by @ngnpope in #2646
- Use github permalink to blob view, not blame view by @UnknownPlatypus in #2647
- add
null
keyword argument toManyToManyField
init by @lev-blit in #2648 - Run stubtest on 2 latest python versions by @sobolevn in #2651
- Stronger type for
settings.AUTH_PASSWORD_VALIDATORS
by @UnknownPlatypus in #2652 - Fix missing at runtime 3 by @UnknownPlatypus in #2653
- Enable a few more ruff rules by @UnknownPlatypus in #2655
- Update django gis backend by @UnknownPlatypus in #2657
- Fix
django.http
errors by @UnknownPlatypus in #2654 - Add
mysqlclient
deps to reveal mysql module stubtest errors by @UnknownPlatypus in #2656 - Update
django.core.handlers
by @UnknownPlatypus in #2660 - Fix a few errors related to the metaclass
MediaDefiningClass
by @UnknownPlatypus in #2662 - Update django to 5.2.1 by @sobolevn in #2664
- Add a test for missing generics in stubs by @UnknownPlatypus in #2659
- Contribute to class by @UnknownPlatypus in #2666
- Restore support for mypy v1.13 by @ngnpope in #2669
- Fix a crash on mypy master branch by @ngnpope in #2670
- Update _AsSqlType to allow tuple[str, tuple] by @jacobtylerwalls in #2673
- fix typing for get_auto_imports, get_namespace, and run_formatters by @BlaackWizard in #2674
- fix: django.contrib.staticfiles for 5.2 by @skv0zsneg in #2684
- Fix postgres OrderableAggMixin & BTreeIndex by @skv0zsneg in #2686
- Switch to pyproject.toml + PEP621 by @UnknownPlatypus in #2688
- Fix some django52 by @skv0zsneg in #2691
- Use
uv
to manage dev dependencies by @UnknownPlatypus in #2698 - Add tests for ClassVar-annotated Migration fields by @zyv in #2702
- Add support for mypy v1.16 by @ngnpope in #2703
- Weaken response argument types in django.utils.cache by @cjwatson in #2704
- Add stub for
django.db.models.expressions.Expression.identity
by @cjwatson in #2685 - change
assertFormError
form arg type to BaseForm by @marxide in #2705 - Updated the "LogEntryManager" class' "log_action" and "log_actions" methods by @ataylor32 in #2708
- Fix signature of
LogEntryManager.log_actions
by @youtux in #2710 - Add "django.contrib.auth.management.commands.createsuperuser" annotations by @brianhelba in #2701
New Contributors
- @rafailmdzdv made their first contribution in #2638
- @lev-blit made their first contribution in #2648
- @BlaackWizard made their first contribution in #2674
- @skv0zsneg made their first contribution in #2684
- @cjwatson made their first contribution in #2704
- @marxide made their first contribution in #2705
- @ataylor32 made their first contribution in #2708
Full Changelog: 5.2.0...5.2.1
5.2.0
Important changes
- We now support [email protected] LTS release!
- Partial Django support is moved to 5.0 from 4.2
- We now also run all checks in this repo under
mypy --strict
mode - Minimal
mypy
version is updated to1.13
What's Changed
- fix
format_lazy
typing by @ashm-dev in #2504 - Update models's fields'
_Choices
type by @stianjensen in #2476 - fix: Add
context_data
attribute to _MonkeyPatchedW/ASGIResponse. by @PacificGilly in #2509 - Fix id and pk of AnonymousUser by @stickperson in #2515
- Add docs about "
type[Model]
does not haveobjects
attribute" by @sobolevn in #2519 - Update
db.migrations.operations
by @Viicos in #2349 - Add
select_format()
methods by @adamchainz in #2525 - Tidy
django.conf.urls
by @adamchainz in #2528 - Fix
Func.function
by @adamchainz in #2529 - Add
ClassVar
annotations on mutableModelAdmin
types forruff
by @zyv in #2524 - Add
ClassVar
annotations onMigration
class attributes by @zyv in #2530 - Remove insecure password hashers by @adamchainz in #2537
- Update for
Model.[a]save()
signature change by @adamchainz in #2535 - Update TestCase classes for Django 5.1 by @adamchainz in #2540
- Improve admin decorators by @adamchainz in #2538
- Update for template system checks change by @adamchainz in #2536
- Remove ForeignObjectRel.is_hidden() by @adamchainz in #2539
- Correct Field.slice_expression() 'length' argument name. by @adamchainz in #2548
- Update django.urls for Django 5.1 by @adamchainz in #2546
- Update django.db.models.options.Options for Django 5.1 by @adamchainz in #2545
- Add admin is_collapsible() methods by @adamchainz in #2541
- Update django.template for Django 5.1 by @adamchainz in #2543
- Add new system checks from Django 5.1 by @adamchainz in #2542
- Add full signatures to CheckConstraint.init overloads by @adamchainz in #2544
- Make Model.[a]save() keyword-only by @adamchainz in #2550
- Add query_params argument to test tools from Django 5.1 by @adamchainz in #2547
- fix #2552 by add ModelIterable to _need_generic by @lucemia in #2553
- Add window frame exclusion from Django 5.1 by @adamchainz in #2554
- Improve process_view() methods by @adamchainz in #2556
- Update core.files.storages for Django 5.1 by @adamchainz in #2558
- Update contrib.auth for Django 5.1 by @adamchainz in #2555
- Complete JSONObject by @adamchainz in #2560
- Fix FieldCacheMixin.cache_name by @adamchainz in #2562
- Use AbstractContextManager instead of
@contextmanager
by @adamchainz in #2561 - Add ModelForm.declared_fields by @adamchainz in #2557
- Update test.selenium for Django 5.1 by @adamchainz in #2559
- Update database expressions for Django 5.1 by @adamchainz in #2563
- fixed typing in contrib.auth.decorators by @Rusich90 in #2564
- Update
_Choices
type for forms by @mrgalopes in #2565 - Update some database backend attributes for Django 5.1 by @adamchainz in #2567
- Update PostgreSQL backend
is_postgresql_*
properties for Django 5.1 by @adamchainz in #2566 - Remove unused code from the plugin by @ngnpope in #2570
- Add
db_table_comment
to model meta by @ngnpope in #2571 - Fix
BaseModelAdmin.get_inlines()
return type by @MaestroXXXVIII in #2576 - Fix a few typos by @UnknownPlatypus in #2579
- Document custom field typing by @UnknownPlatypus in #2578
- Improve stubs for
flatten
andflatten_fieldsets
by @ngnpope in #2572 - Improve typing of choices by @ngnpope in #2582
- Run tests in parallel by @UnknownPlatypus in #2580
- Make GeneratedField parameter db_persist required by @JasonLovesDoggo in #2568
- Re-add explicit test cache disabling by @UnknownPlatypus in #2589
- Ignore
__slotnames__
by @adamchainz in #2584 - Update a bunch of stuff for Django 5.1 by @adamchainz in #2585
- Add get_refs() to BaseExpression and WhereNode by @adamchainz in #2586
- Update Django 4.2 LTS version to 4.2.20 by @intgr in #2592
- Allow tuples for some
TypedModelMeta
fields by @ngnpope in #2594 - Update
django.contrib.gis.geoip2
stubs by @ngnpope in #2593 - Update django to 5.2 by @sobolevn in #2596
- Fix django.urls.base.reverse after 5.2 by @simwr872 in #2595
- Update
django.core.validators
for Django 5.2 by @JaeHyuckSa in #2598 - Update
django.test.client
anddjango.utils
for Django 5.2 by @JaeHyuckSa in #2599 - Update
django.contrib.auth.backends
for Django 5.2 by @JaeHyuckSa in #2600 - Update
django.contrib.auth.models
for Django 5.2 by @JaeHyuckSa in #2601 - Allow
MutableMapping
forForm.Initial
by @UnknownPlatypus in #2604 - Update
django.contrib.admin
for Django 5.2 by @JaeHyuckSa in #2607 - Update
django.db.models.sql
for Django 5.2 by @JaeHyuckSa in #2606 - Update
django.forms.widgets
for Django 5.2 by @federicobond in #2608 - create and re-use
TypeAlias
es andTypeVar
s for "user" and "any user" by @terencehonles in #2384 - Update
django.contrib
for Django 5.2 by @JaeHyuckSa in #2611 - Add stub for
get_select2_language
fromdjango.contrib.admin.widgets
by @michalpokusa in #2612 - Update
django.core.management.commands
for Django 5.2 by @JaeHyuckSa in #2613 - Restrict setuptools to
<79.0.0
forSETUPTOOLS_ENABLE_FEATURES=legacy-editable
to work by @michalpokusa in #2617 - Add EmailMultiAlternatives.body_contains() by @cuu508 in #2618
- Add HttpResponse.text by @cuu508 in #2622
- Allow tuples for some
Options
fields by @ngnpope in #2627 - Add
__all__
by @donBarbos in #2624 - Fix some django 5.2 new missing parameters by @sobolevn in #2629
- [5.2] Improve
django.http.request.MediaType
by @sobolevn in #2631 - [5.2] Fix new errors in
django.http
module by @sobolevn in #2632 - [5.2] Fix
django.template.library
by @sobolevn in #2633 - Update
django.core.serializers
for Django 5.2 by @JaeHyuckSa in #2614 - Update contrib.gis for Django 5.1 by @adamchainz in #2587
- Update some field attributes for Django 5.1 by @adamchainz in #2583
New Contributors
- @stianjensen made their first contri...
5.1.3
What's Changed
- Support [email protected] by @sobolevn in #2502
- Support [email protected] by @sobolevn in #2482
- Support [email protected] by @sobolevn in #2503
- Fix
ContentType
model fields to be infered asAny
, refs #2446 by @sobolevn in #2483 - Fix
@deprecated
based on the review by @sobolevn in #2485 - Fix error with
null=True
andAny
type param forField
types by @sobolevn in #2492 - Fix types for
TestCase.assertJSON{Not,}Equal
by @nickstenning in #2497 - DomainNameValidator types by @HansAarneLiblik in #2498
New Contributors
- @nickstenning made their first contribution in #2497
Full Changelog: 5.1.2...5.1.3