Skip to content
This repository was archived by the owner on Nov 15, 2026. It is now read-only.

django-ty 0.5.0

Choose a tag to compare

@regularkevvv regularkevvv released this 08 Oct 06:30
Immutable release. Only release title and notes can be modified.
b0531d8

Track Django model auto-primary-key state through construction, loading, saving, deletion, aliases, and branches. Requires ty-extended 0.84.4 or later in the 0.84 series.

  • Unsaved auto IDs are now nullable or unset; Book(id=123) establishes an ID before saving. Successful saves establish IDs and deletion clears them. This changes the inferred types from 0.4.0.
  • Validate callable defaults by their return values and reject invalid intermediate lookup paths and known invalid __in values.
  • Preserve custom request subclass types and follow Django's QueryDict mutability rules.
  • Retain conservative types for overrides, uncertain saves, and project signal handlers. Dynamic or external handlers that change IDs require model-state = false; see the documented limits.

Verified 166 contract assertions and 83 runtime proofs across all 18 supported Django/Python pairs, nine QueryDict runtime cases, 50 Rust tests, 26 Python tooling tests, Clippy, formatting, wheel installation, and 98.23% Rust line coverage.

Install with uv add django-ty==0.5.0. Enable installed plugin discovery with auto-discover = true under [tool.ty.plugins].

Compatibility results cover the documented corpus.