Repository navigation
Release 1.1.9 - #2302
Open
waketzheng wants to merge 3 commits into
Open
Release 1.1.9#2302waketzheng wants to merge 3 commits into
waketzheng wants to merge 3 commits into
Conversation
Merging this PR will not alter performance
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's Changed
Added
Q.__bool__()soQobjects with no filters/children (including nested emptyQchildren) are falsy. (feat: q to bool #2227)passwordcredential now accepts a sync or async callable, resolved once per new connection, to support short-lived credentials such as AWS RDS/Aurora IAM tokens and Azure Entra ID tokens. (feat(postgres): allow password to be a sync/async callable #2261)Changed
tortoise.contrib.starlettenow only supports Starlette 1.0+ (This does not affect FastAPI users; you can continue using FastAPI with any version of Starlette). (Support Starlette 1.0+ #2282)Fixed
RemoveIndex/ partialRemoveConstraintnow schema-qualifyDROP INDEX, so indexes on models withMeta.schemacan be dropped when they are not on the connectionsearch_path. (DROP INDEX in migrations is not schema-qualified (PostgreSQL/Oracle) — breaks RemoveIndex/RemoveConstraint for models outside the default schema #2288)ForeignKeyField/OneToOneFieldno longer lose a declaredsource_fieldwhen deconstructed.makemigrationswrote the generated<field>_idbacking field name as the column name, so a migrated schema disagreed withgenerate_schemas()and neither path reported an error. (Keep the declared source_field when deconstructing a FK #2284)QuerySet.distinct().count()no longer counts rows duplicated by a join (e.g. filtering on a m2m relation); it now counts distinct primary keys and matches the number of rows the query returns. (fix(queryset): make distinct().count() ignore join-duplicated rows #2255)DecimalFieldno longer strips the scale it just applied:to_python_value()called.normalize()immediately after.quantize(), so aDecimalField(max_digits=12, decimal_places=2)holding100.00came back asDecimal('1E+2')and rendered as1E+2in strings, f-strings and JSON. (fix: DecimalField no longer strips the scale it just quantized to #2271)register_tortoisenow enables the global connection fallback, so database access works when BlackSheep runs handlers in tasks other than the one that initialized the ORM. (Fix BlackSheep cross-task database access #2248)Metanow inheritsMeta.orderingfrom its abstract base model when it does not define its own. (Inherit Meta.ordering from abstract base models (#2046) #2236)IntEnumField/CharEnumFieldis nowtortoise.fields.Field[EnumType]instead ofEnumType. (Update the return type hint forIntEnumField/CharEnumFieldfromEnumTypetotortoise.fields.Field[EnumType](fixes #2155) #2243)AlterModelOptionsnow clears options that were removed from the model, instead of only merging in the ones that remain; removing a model docstring no longer makesmakemigrationsregenerate the same migration on every run. (makemigrations keeps regenerating the same migration after a model docstring is removed #2279)Model.update_or_create()now applies the caller's defaults after losing a concurrent insert, re-reading the current row through the existing transactional update path. Creation is attempted at most twice, with a final locked read after the last conflict; repeated concurrent deletions that exhaust recovery raiseOperationalErrorrather than retrying indefinitely. (fix(models): apply defaults after concurrent inserts #2276)psycopg.OperationalError: the connection is closed. The check is a cheap no-op query on an already-open socket, so the added latency per checkout is negligible next to a real query. (fix(psycopg): check connection health on pool checkout #2285)prefetch_related()on m2m fields ignoringselect_related(),annotate(), andorder_by()applied to the prefetched queryset. (feat: rewrote the method for getting m2m objects #2205)pydantic_model_creatorno longer raisesTypeErrorfor models with annotations whose origin is not a class, such asLiteral[...]. (fix(pydantic): handle non-class annotation origins in is_field_annotation #2311)New Contributors
IntEnumField/CharEnumFieldfromEnumTypetotortoise.fields.Field[EnumType](fixes #2155) #2243Full Changelog: 1.1.8...1.1.9