The NetBSD Project

CVS log for pkgsrc/databases/py-tortoise-orm/Makefile

[BACK] Up to [cvs.NetBSD.org] / pkgsrc / databases / py-tortoise-orm

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.52: download - view: text, markup, annotated - select for diffs
Mon Oct 19 12:18:08 2026 UTC (3 weeks, 6 days ago) by adam
Branches: MAIN
CVS tags: HEAD
Diff to: previous 1.51: preferred, colored
Changes since revision 1.51: +4 -4 lines
py-tortoise-orm: updated to 1.1.9

1.1.9

Added

Q.__bool__() so Q objects with no filters/children (including nested empty Q children) are falsy.
PostgreSQL password credential 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.

Changed

tortoise.contrib.starlette now only supports Starlette 1.0+ (This does not affect FastAPI users; you can continue using FastAPI with any version of Starlette).

Fixed

Aggregates now apply _filter when the aggregated argument is an F() or a combined expression (e.g. Sum(F("price") * F("qty"), _filter=Q(status="paid"))). Previously the filter was silently dropped and every row was aggregated.
Negating an already negated Q now cancels out: ~~Q(...) and .exclude(~Q(...)) used to keep a single NOT, so they returned the rows the caller meant to drop.
PostgreSQL and Oracle RemoveIndex / partial RemoveConstraint now schema-qualify DROP INDEX, so indexes on models with Meta.schema can be dropped when they are not on the connection search_path.
ForeignKeyField/OneToOneField no longer lose a declared source_field when deconstructed. makemigrations wrote the generated <field>_id backing field name as the column name, so a migrated schema disagreed with generate_schemas() and neither path reported an error.
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.
DecimalField no longer strips the scale it just applied: to_python_value() called .normalize() immediately after .quantize(), so a DecimalField(max_digits=12, decimal_places=2) holding 100.00 came back as Decimal('1E+2') and rendered as 1E+2 in strings, f-strings and JSON.
BlackSheep: register_tortoise now enables the global connection fallback, so database access works when BlackSheep runs handlers in tasks other than the one that initialized the ORM.
fix(queryset): support DELETE/UPDATE with filters on related fields.
Fix naive DatetimeField timezone drift.
A model with its own Meta now inherits Meta.ordering from its abstract base model when it does not define its own.
The return type hint for IntEnumField/CharEnumField is now tortoise.fields.Field[EnumType] instead of EnumType.
Make EmailValidator allowed_domains actually restrict domains.
AlterModelOptions now clears options that were removed from the model, instead of only merging in the ones that remain; removing a model docstring no longer makes makemigrations regenerate the same migration on every run.
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 raise OperationalError rather than retrying indefinitely.
psycopg: the connection pool now validates a connection on checkout, so one silently dropped by the network while idle (a firewall or load balancer closing it, a DB restart, ...) gets transparently replaced instead of being handed to the caller and failing with 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.
Fixed prefetch_related() on m2m fields ignoring select_related(), annotate(), and order_by() applied to the prefetched queryset.
pydantic_model_creator no longer raises TypeError for models with annotations whose origin is not a class, such as Literal[...].
Filtering by a related model instance on a ForeignKeyField/OneToOneField declared with a non-primary-key to_field now uses the to_field value instead of the instance's primary key, so the generated query targets the correct column.
Database URLs with an empty host (e.g. postgres:///db?host=/var/run/postgresql&user=u) no longer overwrite host/user/password given in the query string, so unix domain sockets work.

Revision 1.51: download - view: text, markup, annotated - select for diffs
Fri Oct 16 19:43:44 2026 UTC (4 weeks, 2 days ago) by adam
Branches: MAIN
Diff to: previous 1.50: preferred, colored
Changes since revision 1.50: +2 -2 lines
Forget Python 3.10

Revision 1.50: download - view: text, markup, annotated - select for diffs
Tue Aug 11 05:40:26 2026 UTC (3 months ago) by adam
Branches: MAIN
CVS tags: pkgsrc-2026Q3-base, pkgsrc-2026Q3
Diff to: previous 1.49: preferred, colored
Changes since revision 1.49: +2 -2 lines
py-tortoise-orm: updated to 1.1.8

1.1.8

Added

QuerySet.union() — SQL UNION query support for combining results from multiple QuerySets, including support for union across different models, union(all=True) for duplicates, order_by(), limit(), and count().
feat: add postgresql:// scheme as alias for asyncpg
feat: add pre commit config and fix codespell issues
feat: django compatibility field name
feat: expose classmethod to build tortoise config
QuerySet.contains() method to check if an object exists in a queryset.
Added comprehensive EXPLAIN support for MySQL and PostgreSQL.
Built-in DomainNameValidator, URLValidator, and EmailValidator classes for common validation patterns.

Fixed

MigrationRecorder now uses parameterized queries; fixes MariaDB/MySQL rejecting ISO-8601 applied_at values.
fix(migrations): use parameterized queries in MigrationRecorder
Applies model generics on relational fields functions
fix: MSSQL connection left in busy state after insert
db_default on ForeignKeyField/OneToOneField now propagates to the underlying <fk>_id column, so CREATE TABLE emits the DEFAULT clause for FK columns.
Fix db_default on FK/O2O dropped during _init_relations
MigrationRecorder no longer emits tortoise's own pk field DeprecationWarning when applying migrations; it now builds its bookkeeping model with primary_key=True.
QuerySet.count() now matches the limited query result for the LIMIT/OFFSET edge cases: it returns 0 (instead of a negative number) when offset() exceeds the total row count, and 0 (instead of the total) for limit(0).
tests: cover Q inequality and unhashable behavior
Field declarations on models now resolve to their concrete type (e.g. CharField[str]) in Pyright/Pylance instead of Field[Unknown]; the Field.__new__ type-check stub now returns Self.
Type hint for TransactionContext now returns a TransactionalDBClient instead of a raw database connection. This change gives the correct inferred type for the transaction context.
Fix TSVectorField returned value conversion.

Revision 1.49: download - view: text, markup, annotated - select for diffs
Sun Jun 28 15:41:12 2026 UTC (4 months, 2 weeks ago) by wiz
Branches: MAIN
Diff to: previous 1.48: preferred, colored
Changes since revision 1.48: +2 -2 lines
*: limit Python versions due to py-numpy dropping Python 3.11 support

Revision 1.48: download - view: text, markup, annotated - select for diffs
Fri Mar 27 10:22:07 2026 UTC (7 months, 2 weeks ago) by adam
Branches: MAIN
CVS tags: pkgsrc-2026Q2-base, pkgsrc-2026Q2
Diff to: previous 1.47: preferred, colored
Changes since revision 1.47: +3 -3 lines
py-tortoise-orm: updated to 1.1.7

1.1.7

Added

Tests for model validators.

Fixed

Reorder delete model operations in migrations to avoid foreign key constraint errors.
Return value generated by db_default on create instead of None.
Column comment alteration now works correctly for MySQL and PostgreSQL; fixed db_default handling for MySQL.
Fix docstrings for a few classes.

Changed

Improved Pydantic JSON dump performance.

Revision 1.47: download - view: text, markup, annotated - select for diffs
Fri Mar 6 06:23:42 2026 UTC (8 months, 1 week ago) by adam
Branches: MAIN
CVS tags: pkgsrc-2026Q1-base, pkgsrc-2026Q1
Diff to: previous 1.46: preferred, colored
Changes since revision 1.46: +2 -2 lines
py-tortoise-orm: updated to 1.1.6

1.1.6

Fixed

Migration generator now correctly orders AddIndex, RemoveIndex, AddConstraint, RemoveConstraint operations when adding/removing a field to a model that is used in an index or constraint.
CreateModel migrations now include DEFAULT clauses for fields with db_default set. Previously only AddField emitted defaults correctly.
AlterField migrations now detect max_length changes (e.g. VARCHAR(32) → VARCHAR(64)) and emit the correct ALTER statements across all backends.
backward_relations=False in PydanticMeta now only excludes unannotated backward relations — fields explicitly annotated with ReverseRelation in the model class body are preserved.
MySQL session time_zone now uses the configured timezone instead of always defaulting to +0:00 when use_tz=True.
Plus sign (+) in database URL passwords is no longer incorrectly decoded as a space.

Revision 1.46: download - view: text, markup, annotated - select for diffs
Mon Feb 23 10:10:38 2026 UTC (8 months, 3 weeks ago) by adam
Branches: MAIN
Diff to: previous 1.45: preferred, colored
Changes since revision 1.45: +2 -2 lines
py-tortoise-orm: updated to 1.1.5

1.1.5
Fixed crash for makemigrations on tuple index with new model

Revision 1.45: download - view: text, markup, annotated - select for diffs
Tue Feb 17 13:15:10 2026 UTC (8 months, 4 weeks ago) by adam
Branches: MAIN
Diff to: previous 1.44: preferred, colored
Changes since revision 1.44: +2 -2 lines
py-tortoise-orm: updated to 1.1.4

1.1.4

Added

CheckConstraint support in Meta.constraints — named check constraints are now captured by the migration autodetector, enabling AddConstraint/RemoveConstraint/RenameConstraint generation via makemigrations.
UniqueConstraint.condition parameter for partial unique indexes on PostgreSQL (emitted as CREATE UNIQUE INDEX ... WHERE).

Fixed

FK field-to-column resolution in constraint operations — FK fields like organization are now correctly resolved to their DB column (e.g. organization_id) in add_constraint, remove_constraint, and rename_constraint across all backends.
MSSQL HASHBYTES expression default — RandomHex now wraps NEWID() with CAST(... AS NVARCHAR(36)) to avoid implicit conversion error.
MySQL ALTER COLUMN SET DEFAULT template now wraps expression defaults in parentheses.
RenameConstraint operation now preserves constraint type and fields during forward/backward migrations.
MySQL schema editor: FK index protection (_create_missing_fk_index) prevents MySQL error 1553 when dropping the only index covering a foreign key column.
MySQL schema editor: expression default two-step workaround for ADD COLUMN with non-deterministic SqlDefault expressions (e.g. RANDOM_BYTES).
Multi-column constraint introspection — constraint name resolution now matches on the exact set of columns across all backends (PostgreSQL, MySQL, MSSQL, SQLite, Oracle).
Tortoise.close_connections() now propagates call to current context.

Revision 1.44: download - view: text, markup, annotated - select for diffs
Mon Feb 16 18:09:02 2026 UTC (8 months, 4 weeks ago) by adam
Branches: MAIN
Diff to: previous 1.43: preferred, colored
Changes since revision 1.43: +2 -2 lines
py-tortoise-orm: updated to 1.1.3

1.1.3

Added

RandomHex dialect-aware SqlDefault subclass for generating random hex strings across all backends.
Meta.constraints support on models — named UniqueConstraint objects are now captured by the migration autodetector, enabling AddConstraint/RemoveConstraint generation via makemigrations.
MySQL schema editor: _alter_field override using MODIFY COLUMN for NULL/NOT NULL changes; backtick-quoted ALTER_FIELD_* templates.
MSSQL schema editor: _alter_field override with ALTER COLUMN for nullability, named default constraint management via sys.default_constraints, bracket-quoted templates, and self-referencing FK CASCADE → NO ACTION downgrade.

Fixed

MySQL migrations: ALTER COLUMN ... SET NOT NULL / DROP NOT NULL now correctly emits MODIFY COLUMN col type NOT NULL/NULL.
MSSQL migrations: DELETE_CONSTRAINT_TEMPLATE and UNIQUE_CONSTRAINT_CREATE_TEMPLATE now use bracket quoting [name] instead of double quotes.
MSSQL migrations: self-referencing foreign keys with CASCADE no longer fail with error 1785; automatically downgraded to NO ACTION.

Revision 1.43: download - view: text, markup, annotated - select for diffs
Sun Feb 15 12:56:08 2026 UTC (8 months, 4 weeks ago) by adam
Branches: MAIN
Diff to: previous 1.42: preferred, colored
Changes since revision 1.42: +2 -2 lines
py-tortoise-orm: updated to 1.1.2

1.1.2

Fixed

Fixed optimisation issue, if you didn't have pydantic installed, Tortoise would try to import it on every JSONField deserialization, lowering performance.


1.1.1

Added

SqlDefault and Now expressions for db_default — use db_default=SqlDefault("...") to emit raw SQL expressions (e.g. CURRENT_TIMESTAMP) as database defaults. Now() is a convenience shorthand for SqlDefault("CURRENT_TIMESTAMP").

Changed

Field(default=...) and auto_now / auto_now_add no longer emits a DEFAULT clause in generate_schemas(). The default parameter is Python-only; use db_default for database-level defaults. This aligns generate_schemas() with migrations, which don't emitted DEFAULT for default=.


1.1.0

Added

db_default parameter for fields — set database-level DEFAULT clauses that propagate to schema generation and migrations. Unlike default (Python-only), db_default is persisted in the DB schema and applied even for rows inserted outside the ORM.
Model.construct() classmethod for building model instances without field validation — useful in test factories and fixtures.
truncate_all_models() now respects foreign key constraints using topological ordering (SQLite/MySQL) or TRUNCATE ... CASCADE (PostgreSQL).
Auto-recreate database connection when event loop changes. Enables easier testing without session level fixtures

Fixed

Type checking of None assignment to nullable fields.
Fix set global fallback default in Sanic register_tortoise.
Escape [ ] for db url parsing.
Fix UnicodeEncodeError by using UTF-8 encoding for migration files.

Revision 1.42: download - view: text, markup, annotated - select for diffs
Wed Feb 11 09:11:54 2026 UTC (9 months ago) by adam
Branches: MAIN
Diff to: previous 1.41: preferred, colored
Changes since revision 1.41: +3 -3 lines
py-tortoise-orm: updated to 1.0.0

1.0.0

Breaking Changes

Minimum Python version raised to 3.10 (was 3.9).
``use_tz`` now defaults to ``True`` (was False). Set use_tz=False explicitly if you need naive datetimes.
Context-first architecture: All ORM state now lives in TortoiseContext instances. Tortoise.init() returns a TortoiseContext (previously returned None). Multiple separate asyncio.run() calls require explicit context management; the typical single asyncio.run(main()) pattern works unchanged.
Removed legacy test infrastructure: test.TestCase, test.IsolatedTestCase, test.TruncationTestCase, test.SimpleTestCase, initializer(), finalizer(), env_initializer(), getDBConfig(). Use tortoise_test_context() with pytest instead.
Removed ``pytz`` dependency: Timezone handling now uses the standard library zoneinfo module. Tortoise APIs return ZoneInfo objects instead of pytz timezones.
``DatetimeField``/``TimeField`` with ``auto_now=True`` no longer implicitly sets auto_now_add=True. In practice auto_now=True alone still sets the value on every save (including creation), so this is unlikely to affect most users. The internal flag coupling was removed for correctness.
Shell extras required: Interactive shell dependencies are now optional. Install with pip install tortoise-orm[ipython] or pip install tortoise-orm[ptpython].

Added

Native migrations framework with CLI commands: tortoise makemigrations, tortoise migrate, tortoise sqlmigrate. Supports RunPython, RunSQL, reversible migrations, and multi-app projects.
Database schema support for PostgreSQL and MSSQL (on MySQL maps to database name) — tables can live in non-default schemas (e.g., warehouse.inventory), with cross-schema relations and migration support.
PostgreSQL full-text search: TSVectorField, SearchVector, SearchQuery, SearchRank, SearchHeadline expressions, and GIN/GiST index support.
Query API (tortoise.query_api) for building and executing custom pypika queries against models, with Model.get_table() classmethod.
TortoiseContext — explicit context manager for ORM state with full isolation.
tortoise_test_context() — modern pytest fixture helper for test isolation.
get_connection(alias) / get_connections() — functions to access connections from current context.
Tortoise.close_connections() — restored (was deprecated in 0.19) as the canonical way to close connections, now context-aware.
Tortoise.is_inited() — explicit method version of Tortoise._inited property.
ForeignKeyField and ManyToManyField now accept a model class directly, not just string references.
DateField now supports __year / __month / __day filters.

Changed

Framework integrations (FastAPI, Starlette, Sanic, etc.) now use Tortoise.close_connections() internally.
ConnectionHandler uses per-instance ContextVar storage for context isolation.
Tortoise.apps and Tortoise._inited are now classproperty descriptors.
Performance optimizations for model hydration, object construction, and query building.
Pydantic model creator internals cleaned up: removed legacy validator, improved computed field handling.

Deprecated

from tortoise import connections — use get_connection() / get_connections() instead (still works but deprecated).

Fixed

use_tz=False now correctly preserves naive datetimes instead of silently making them timezone-aware.
Annotations incorrectly selected in ValuesListQuery when not specified in .values_list() fields.
M2M filtering broken when two relations point to the same target model.
Pydantic incorrectly marking fields with default values as Optional.
Model.in_bulk type annotation now supports any primary key type.
Migration bug fixes: field serialization, operation ordering, and sqlmigrate command added.

Revision 1.41: download - view: text, markup, annotated - select for diffs
Tue Feb 3 09:18:41 2026 UTC (9 months, 1 week ago) by adam
Branches: MAIN
Diff to: previous 1.40: preferred, colored
Changes since revision 1.40: +2 -2 lines
py-tortoise-orm: updated to 0.25.4

0.25.4

Fix AttributeError when using tortoise-orm with Nuitka-compiled Python code
Fix 'Self' in python standard library typing.py, but tortoise/model.py required it in 'typing_extensions'
Fix examples should not be installed

Revision 1.40: download - view: text, markup, annotated - select for diffs
Thu Dec 25 16:32:29 2025 UTC (10 months, 3 weeks ago) by adam
Branches: MAIN
Diff to: previous 1.39: preferred, colored
Changes since revision 1.39: +2 -2 lines
py-tortoise-orm: updated to 0.25.3

0.25.3

Fix exception when creating aiosqlite connections on aiosqlite==0.22.0
Fix implicit anyio dependency introduced, but not declared

Revision 1.39: download - view: text, markup, annotated - select for diffs
Mon Dec 22 09:04:23 2025 UTC (10 months, 3 weeks ago) by adam
Branches: MAIN
Diff to: previous 1.38: preferred, colored
Changes since revision 1.38: +4 -5 lines
py-tortoise-orm: updated to 0.25.2

0.25.2

Fixed

Fix grouping by in subqueries
Fix sqlite decimal filter error with __gt

Changed

Official support python3.14
Migrate from poetry to uv
Reorder imports by ruff
Migrate lint tool from isort+black to ruff

Added

Add create() method to reverse ForeignKey relations, enabling parent.children.create() syntax

Revision 1.38: download - view: text, markup, annotated - select for diffs
Thu Oct 9 07:57:28 2025 UTC (13 months, 1 week ago) by wiz
Branches: MAIN
CVS tags: pkgsrc-2025Q4-base, pkgsrc-2025Q4
Diff to: previous 1.37: preferred, colored
Changes since revision 1.37: +2 -2 lines
*: remove reference to (removed) Python 3.9

Revision 1.37: download - view: text, markup, annotated - select for diffs
Sun Sep 28 19:24:26 2025 UTC (13 months, 2 weeks ago) by wiz
Branches: MAIN
Diff to: previous 1.36: preferred, colored
Changes since revision 1.36: +3 -2 lines
py-tortoise-orm: fix for latest poetry-core

Bump PKGREVISION.

Revision 1.36: download - view: text, markup, annotated - select for diffs
Sat Jul 5 11:44:09 2025 UTC (16 months, 1 week ago) by wiz
Branches: MAIN
CVS tags: pkgsrc-2025Q3-base, pkgsrc-2025Q3
Diff to: previous 1.35: preferred, colored
Changes since revision 1.35: +3 -1 lines
*: some more recursive Python restrictions on Python 3.11+

Reported in SmartOS bulk build

Revision 1.35: download - view: text, markup, annotated - select for diffs
Thu Jun 5 14:48:15 2025 UTC (17 months, 1 week ago) by adam
Branches: MAIN
CVS tags: pkgsrc-2025Q2-base, pkgsrc-2025Q2
Diff to: previous 1.34: preferred, colored
Changes since revision 1.34: +3 -3 lines
py-tortoise-orm: updated to 0.25.1

0.25.1

Changed

Force async task switch every 2000 rows when converting db objects to python objects to avoid blocking the event loop

Added

Add no_key parameter to queryset.select_for_update.
F() supports referencing JSONField attributes, e.g. F("json_field__custom_field__nested_id")

Revision 1.34: download - view: text, markup, annotated - select for diffs
Mon Apr 21 06:01:09 2025 UTC (18 months, 3 weeks ago) by adam
Branches: MAIN
Diff to: previous 1.33: preferred, colored
Changes since revision 1.33: +2 -2 lines
py-tortoise-orm: updated to 0.25.0

0.25.0

Fixed

Fix pydantic_model_creator incompatibility with Pydantic 2.11

Changed

Skip database selection if the router is not configured to improve performance

.values(), .values_list() and .only() cannot be used together

Added

.only supports selecting related fields, e.g. .only(“related__field”)

Fixed

Fix pydantic_model_creator incompatibility with Pydantic 2.11

Revision 1.33: download - view: text, markup, annotated - select for diffs
Tue Mar 4 06:07:25 2025 UTC (20 months, 1 week ago) by adam
Branches: MAIN
CVS tags: pkgsrc-2025Q1-base, pkgsrc-2025Q1
Diff to: previous 1.32: preferred, colored
Changes since revision 1.32: +2 -2 lines
py-tortoise-orm: updated to 0.24.2

0.24.2

Fixed

Fix model with multi m2m fields generates wrong references name
Fix using reserved words in order_by
Fix installing tortoise-orm with poetry 2

Changed

Use 'unique' instead of 'create_unique_index' for m2m field

Revision 1.32: download - view: text, markup, annotated - select for diffs
Wed Feb 26 08:15:14 2025 UTC (20 months, 2 weeks ago) by adam
Branches: MAIN
Diff to: previous 1.31: preferred, colored
Changes since revision 1.31: +2 -2 lines
py-tortoise-orm: updated to 0.24.1

0.24.1

Added
- Implement __contains, __contained_by, __overlap and __len for ArrayField

Fixed
- Fix update pk field raises unfriendly error
- Using `.distinct()` with an annotation and `.order_by()` produces invalid SQL for PostgreSQL

Revision 1.31: download - view: text, markup, annotated - select for diffs
Thu Jan 23 16:39:37 2025 UTC (21 months, 3 weeks ago) by adam
Branches: MAIN
Diff to: previous 1.30: preferred, colored
Changes since revision 1.30: +3 -4 lines
py-tortoise-orm: updated to 0.24.0

0.24.0

Fixed
- Rename pypika to pypika_tortoise for fixing package name conflict
- Concurrent connection pool initialization
- `_get_dialects`: support properties

Changed
- Drop support for Python3.8
- Optimize field conversion to database format to speed up `create` and `bulk_create`
- Improved query performance by optimizing SQL generation

0.23.0

Added
- Implement savepoints for transactions
- Added type validation for foreign key fields to ensure type safety. Now raises `ValidationError` when assigning foreign key values with incorrect model types

Fixed
- Fixed a deadlock in three level nested transactions
- Fix backward_relations in PydanticMeta

Revision 1.30: download - view: text, markup, annotated - select for diffs
Wed Jan 22 13:43:39 2025 UTC (21 months, 3 weeks ago) by wiz
Branches: MAIN
Diff to: previous 1.29: preferred, colored
Changes since revision 1.29: +3 -2 lines
py-tortoise-orm: fix PLIST for latest poetry-core

Bump PKGREVISION

Revision 1.29: download - view: text, markup, annotated - select for diffs
Wed Dec 11 08:29:10 2024 UTC (23 months ago) by adam
Branches: MAIN
CVS tags: pkgsrc-2024Q4-base, pkgsrc-2024Q4
Diff to: previous 1.28: preferred, colored
Changes since revision 1.28: +2 -2 lines
py-tortoise-orm: updated to 0.22.2

0.22.2

Fixed
- Fix bug related to `Connector.div` in combined expressions.
- Fix recovery in case of database downtime

Changed
- Parametrizes UPDATE, DELETE, bulk update and create operations
- Parametrizes related field queries

Added
- CharEnumField and IntEnumField is supported by pydantic_model_creator

Revision 1.28: download - view: text, markup, annotated - select for diffs
Mon Nov 25 13:04:12 2024 UTC (23 months, 3 weeks ago) by adam
Branches: MAIN
Diff to: previous 1.27: preferred, colored
Changes since revision 1.27: +3 -3 lines
py-tortoise-orm: updated to 0.22.1

0.22.1

Fixed

- Fix unable to use ManyToManyField if OneToOneField passed as Primary Key
- Fix sorting by Term (e.g. RawSQL)

Revision 1.27: download - view: text, markup, annotated - select for diffs
Wed Nov 20 12:53:23 2024 UTC (23 months, 3 weeks ago) by adam
Branches: MAIN
Diff to: previous 1.26: preferred, colored
Changes since revision 1.26: +4 -4 lines
py-tortoise-orm: updated to 0.22.0

0.22.0

Fixed

- Fix enums not quoted, allowing using of str enums for filters
- Primary key field should not be nullable in pydantic schema
- Fix ambiguous column name when grouping with joining
- Fix same model returned by pydantic_model_creator calls with different arguments

Added

- JSONField adds optional generic support, and supports OpenAPI document generation by specifying `field_type` as a pydantic BaseModel
- Add table_name_generator attribute to Tortoise.init for dynamic table name generation
- Support for annotation and joins F() expressions
- Allow use of annotate fields within Case-When expression
- Added new queryset methods: last(), latest(), earliest()

Changed

- Change old pydantic docs link to new one
- Refactored pydantic_model_creator, interface not changed
- Values are no longer validated to be right type upon loading from database
- Refactored private field names in queryset classes

Revision 1.26: download - view: text, markup, annotated - select for diffs
Mon Oct 14 14:06:45 2024 UTC (2 years, 1 month ago) by adam
Branches: MAIN
Diff to: previous 1.25: preferred, colored
Changes since revision 1.25: +4 -6 lines
py-tortoise-orm: updated to 0.21.7

0.21.7

Fixed
- Fix unittest error with pydantic2.9
- Fix bug when using annotate and count at the same time but the annotation does not match anything, leading to an IndexError
- Added missing field_type for TimeDeltaField
- improve jsonfield type hint
- Fix bug in tortoise.models.Model When a QuerySet uses the only function and then uses the print function to print the returned result, an AttributeError is generated
- Update the pylint plugin to latest astroid version

Added
- Add POSIX Regex support for PostgreSQL and MySQL
- support app=None for tortoise.contrib.fastapi.RegisterTortoise

Revision 1.25: download - view: text, markup, annotated - select for diffs
Sun Aug 18 20:36:30 2024 UTC (2 years, 2 months ago) by adam
Branches: MAIN
CVS tags: pkgsrc-2024Q3-base, pkgsrc-2024Q3
Diff to: previous 1.24: preferred, colored
Changes since revision 1.24: +2 -2 lines
py-tortoise-orm: updated to 0.21.6

0.21.6

Fixed

- Fix bug in `pydantic_model_creator` when a foreign key is not included in `include` param.
- Fix bug in `contrib.sanic.register_tortoise` causing a deadlock when using asyncpg and > 1 workers
- Open psycopg pool with `.open()` to remove deprecated warning
- Fix bug in `bulk_update` when pk field is not `id`
- Fix mysql uuid compression bug
- Fix comment for fk fields without constraint for mysql
- Removed no_delay option for postgres, as it wasn't doing anything

Revision 1.24: download - view: text, markup, annotated - select for diffs
Sat Jul 20 06:22:51 2024 UTC (2 years, 3 months ago) by adam
Branches: MAIN
Diff to: previous 1.23: preferred, colored
Changes since revision 1.23: +2 -2 lines
py-tortoise-orm: updated to 0.21.5

0.21.5

Added

- Propagate `_create_db` parameter to RegisterTortoise.

Revision 1.23: download - view: text, markup, annotated - select for diffs
Thu Jul 4 11:02:15 2024 UTC (2 years, 4 months ago) by adam
Branches: MAIN
Diff to: previous 1.22: preferred, colored
Changes since revision 1.22: +2 -2 lines
py-tortoise-orm: updated to 0.21.4

0.21.4

Added
- Add ObjectDoesNotExistError to show better 404 message.
- DoesNotExist and MultipleObjectsReturned support 'Type[Model]' argument.
- Add argument use_tz and timezone to RegisterTortoise.
- Support await `tortoise.contrib.fastapi.RegisterTortoise`.
- Add `tortoise.contrib.test.init_memory_sqlite`.

Fixed
- Fix `update_or_create` errors when field value changed.
- Fix bandit check error
- Fix potential race condition in ConnectionWrapper
- Fix py312 warning for datetime.utcnow
- Fix reusing values and value_list queries

Changed
- Remove obsolete loop._selector from contrib/test.

Revision 1.22: download - view: text, markup, annotated - select for diffs
Mon Jun 3 08:04:46 2024 UTC (2 years, 5 months ago) by adam
Branches: MAIN
CVS tags: pkgsrc-2024Q2-base, pkgsrc-2024Q2
Diff to: previous 1.21: preferred, colored
Changes since revision 1.21: +2 -2 lines
py-tortoise-orm: updated to 0.21.3

0.21.3

Fixed
- Fix `bulk_update` when using source_field for pk

Revision 1.21: download - view: text, markup, annotated - select for diffs
Sun May 26 18:57:14 2024 UTC (2 years, 5 months ago) by adam
Branches: MAIN
Diff to: previous 1.20: preferred, colored
Changes since revision 1.20: +2 -2 lines
py-tortoise-orm: updated to 0.21.2

0.21.2

Added

- Add `create_unique_index` argument to M2M field and default if it is true

0.21.1

Fixed

- Fix error on using old style `pk=True`

Revision 1.20: download - view: text, markup, annotated - select for diffs
Fri May 24 07:58:52 2024 UTC (2 years, 5 months ago) by adam
Branches: MAIN
Diff to: previous 1.19: preferred, colored
Changes since revision 1.19: +3 -2 lines
py-tortoise-orm: updated to 0.21.0

0.21.0

Added

- Enhancement for FastAPI lifespan support
- Add __eq__ method to Q to more easily test dynamically-built queries
- Added PlainToTsQuery function for postgres
- Allow field's default keyword to be async function
- Add support for queryset slicing.

Fixed

- Fix `DatetimeField` use '__year' report `'int' object has no attribute 'utcoffset'`.
- Fix `bulk_update` when using custom fields.
- Fix `optional` parameter in `pydantic_model_creator` does not work for pydantic v2.
- Fix `get_annotations` now evaluates annotations in the default scope instead of the app namespace.
- Fix `get_or_create` method.
- Use `index_name` instead of `BaseSchemaGenerator._generate_index_name` to generate index name.
- Use subquery for count() and exists() in `QuerySet` to match count result to `QuerySet` result.

Changed

- Change `utils.chunk` from function to return iterables lazily.
- Removed lower bound of id keys in generated pydantic models.
- Rename Field initial arguments `pk`/`index` to `primary_key`/`db_index`.
- Renamed `Model.check` method to `Model._check` to avoid naming collision issues

Breaking Changes

- `bulk_create` now does not return anything.

Revision 1.19: download - view: text, markup, annotated - select for diffs
Fri Apr 26 20:13:03 2024 UTC (2 years, 6 months ago) by adam
Branches: MAIN
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +3 -3 lines
py-tortoise-orm: updated to 0.20.1

0.20.1

Added

- Add binary compression support for `UUIDField` in `MySQL`.
- Only `Model`, `Tortoise`, `BaseDBAsyncClient`, `__version__`, and `connections` are now exported from `tortoise`
- Add parameter `validators` to `pydantic_model_creator`.

Fixed

- Fix order of fields in `ValuesListQuery` when it has more than 10 fields.
- Fix pydantic v2 pydantic_model_creator nullable field not optional.
- Fix pydantic v2.5 unittest error.
- Fix pydantic_model_creator `exclude_readonly` parameter not working.
- Fix annotation propagation for non-filter queries.

Revision 1.18: download - view: text, markup, annotated - select for diffs
Wed Dec 13 19:14:29 2023 UTC (2 years, 11 months ago) by wiz
Branches: MAIN
CVS tags: pkgsrc-2024Q1-base, pkgsrc-2024Q1, pkgsrc-2023Q4-base, pkgsrc-2023Q4
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +2 -1 lines
py-tortoise-orm: add missing tool

Revision 1.17: download - view: text, markup, annotated - select for diffs
Thu Nov 23 07:58:34 2023 UTC (2 years, 11 months ago) by adam
Branches: MAIN
Diff to: previous 1.16: preferred, colored
Changes since revision 1.16: +5 -7 lines
py-tortoise-orm: updated to 0.20.0

0.20.0
------
Added
^^^^^
- Allow ForeignKeyField(on_delete=NO_ACTION)
- Support `pydantic` 2.0.

Fixed
^^^^^
- Fix foreign key constraint not generated on MSSQL Server.
- Fix testcase error with python3.11

Breaking Changes
^^^^^^^^^^^^^^^^
- Drop support for `pydantic` 1.x.
- Drop support for `python` 3.7.
- Param `config_class` of `pydantic_model_creator` is renamed to `model_config`.
- Attr `config_class` of `PydanticMeta` is renamed to `model_config`.

0.19
====

0.19.3
------
Added
^^^^^
- Added config_class option to pydantic model genator that allows the developer to customize the generated pydantic model's `Config` class.
Fixed
^^^^^
- Fastapi example test not working.
- Fix create index sql error.
- Fix dependencies resolve error.
- Fix ignoring zero value of limit.
- Fix ForeignKeyField is none when fk is integer 0.
- Fix limit ignore zero.
- Fix min/max value validators for decimal fields.

0.19.2
------
Added
^^^^^
- Added `schema` attribute to Model's Meta to specify exact schema to use with the model.
Fixed
^^^^^
- Mixin does not work.
- `using_db` wrong position in model shortcut methods.
- Fixed connection to `Oracle` database by adding database info to DBQ in connection string.
- Fixed ORA-01435 error while using `Oracle` database
- Fixed processing of `ssl` option in MySQL connection string.
- Fixed type hinting for `QuerySetSingle`.

0.19.1
------
Added
^^^^^
- Added `Postgres`/`SQLite` partial indexes support.
- Added `Microsoft SQL Server`/`Oracle` support, powered by `asyncodbc <https://github.com/tortoise/asyncodbc>`_, note that which is **not fully tested**.
- Added `optional` parameter to `pydantic_model_creator`.
- Added `using_db` parameter to `Model` shortcut methods.
Fixed
^^^^^
- `TimeField` for `MySQL` will return `datetime.timedelta` object instead of `datetime.time` object.
- Fix on conflict do nothing.
- Fix `_custom_generated_pk` attribute not set in `Model._init_from_db` method.

0.19.0
------
Added
^^^^^
- Added psycopg backend support.
- Added a new unified and robust connection management interface to access DB connections which includes support for
  lazy connection creation and much more. For more details, check out this `PR <https://github.com/tortoise/tortoise-orm/pull/1001>`_
- Added `TimeField`.
- Added `ArrayField`.
Fixed
^^^^^
- Fix `bulk_create` doesn't work correctly with more than 1 update_fields.
- Fix `bulk_update` errors when setting null for a smallint column on postgres.
Deprecated
^^^^^^^^^^
- Existing connection management interface and related public APIs which are deprecated:
 - `Tortoise.get_connection`
 - `Tortoise.close_connections`
Changed
^^^^^^^
- Refactored `tortoise.transactions.get_connection` method to `tortoise.transactions._get_connection`.
 Note that this method has now been marked **private to this module and is not part of the public API**

Revision 1.16: download - view: text, markup, annotated - select for diffs
Tue Jan 4 20:52:45 2022 UTC (4 years, 10 months ago) by wiz
Branches: MAIN
CVS tags: pkgsrc-2023Q3-base, pkgsrc-2023Q3, pkgsrc-2023Q2-base, pkgsrc-2023Q2, pkgsrc-2023Q1-base, pkgsrc-2023Q1, pkgsrc-2022Q4-base, pkgsrc-2022Q4, pkgsrc-2022Q3-base, pkgsrc-2022Q3, pkgsrc-2022Q2-base, pkgsrc-2022Q2, pkgsrc-2022Q1-base, pkgsrc-2022Q1
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +2 -1 lines
*: bump PKGREVISION for egg.mk users

They now have a tool dependency on py-setuptools instead of a DEPENDS

Revision 1.15: download - view: text, markup, annotated - select for diffs
Thu Dec 30 13:05:29 2021 UTC (4 years, 10 months ago) by adam
Branches: MAIN
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +2 -2 lines
Forget about Python 3.6

Revision 1.14: download - view: text, markup, annotated - select for diffs
Fri Feb 5 07:51:22 2021 UTC (5 years, 9 months ago) by adam
Branches: MAIN
CVS tags: pkgsrc-2021Q4-base, pkgsrc-2021Q4, pkgsrc-2021Q3-base, pkgsrc-2021Q3, pkgsrc-2021Q2-base, pkgsrc-2021Q2, pkgsrc-2021Q1-base, pkgsrc-2021Q1
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +2 -2 lines
py-tortoise-orm: updated to 0.16.21

0.16.21
- Fixed validating JSON before decoding.
- Add model method `update_or_create`.
- Add `batch_size` parameter for `bulk_create` method.
- Fix save with F expression and field with source_field.

Revision 1.13: download - view: text, markup, annotated - select for diffs
Sun Jan 24 20:10:34 2021 UTC (5 years, 9 months ago) by adam
Branches: MAIN
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +2 -2 lines
py-tortoise-orm: updated to 0.16.20

0.16.20
- Add model field validators.
- Allow function results in group by.

Revision 1.12: download - view: text, markup, annotated - select for diffs
Sun Jan 3 09:57:40 2021 UTC (5 years, 10 months ago) by adam
Branches: MAIN
Diff to: previous 1.11: preferred, colored
Changes since revision 1.11: +3 -3 lines
py-tortoise-orm: updated to 0.16.19

0.16.19
- Replace set `TZ` environment variable to `TIMEZONE` to avoid affecting global timezone.
- Allow passing module objects to `models_paths` param of `Tortoise.init_models()`.
- Implement `PydanticMeta.backward_relations`.
- Allow overriding `PydanticMeta` in `PydanticModelCreator`.
- Fixed make_native typo to make_naive in timezone module

Revision 1.11: download - view: text, markup, annotated - select for diffs
Tue Nov 17 09:49:36 2020 UTC (5 years, 11 months ago) by adam
Branches: MAIN
CVS tags: pkgsrc-2020Q4-base, pkgsrc-2020Q4
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +6 -6 lines
py-tortoise-orm: updated to 0.16.18

0.16.18

Support custom function in update.
Add Model.refresh_from_db.
Add timezone support, be careful to upgrade to this version, see docs for details.
Remove aerich in case of cyclic dependency.

Revision 1.10: download - view: text, markup, annotated - select for diffs
Mon Oct 26 09:06:53 2020 UTC (6 years ago) by adam
Branches: MAIN
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +2 -2 lines
py-tortoise-orm: updated to 0.16.17

0.16.17
Add on_delete in ManyToManyField.
Support F expression in annotate.
Fix QuerySet.select_related in case of join same table twice.
Integrate Aerich into the install.

Revision 1.9: download - view: text, markup, annotated - select for diffs
Tue Sep 29 09:54:38 2020 UTC (6 years, 1 month ago) by adam
Branches: MAIN
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +2 -2 lines
py-tortoise-orm: updated to 0.16.16

0.16.16
Fixed inconsistency in integrity error exception of FastAPI
add OSError to _get_comments except block

Revision 1.8: download - view: text, markup, annotated - select for diffs
Fri Sep 18 13:11:58 2020 UTC (6 years, 1 month ago) by adam
Branches: MAIN
CVS tags: pkgsrc-2020Q3-base, pkgsrc-2020Q3
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +3 -3 lines
py-tortoise-orm: updated to 0.16.15

0.16.15
Make DateField accept valid date str.
Add QuerySet.select_for_update().
check default for not None on pydantic model creation
propagate default to pydantic model
Add QuerySet.select_related().
Add custom attribute name for Prefetch instruction.
Add db_constraint for RelationalField family.

Revision 1.7: download - view: text, markup, annotated - select for diffs
Mon Jul 27 06:39:14 2020 UTC (6 years, 3 months ago) by adam
Branches: MAIN
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +2 -2 lines
py-tortoise-orm: updated to 0.16.14

0.16.14
Make F expression work with QuerySet.filter().
Include py.typed in source distribution.
Added datetime parsing from int for fields.DatetimeField.
get_or_create passes the using_db= on if provided.
Allow custom loop and connection_class parameters to be passed on to asyncpg.

Revision 1.6: download - view: text, markup, annotated - select for diffs
Fri Jun 12 17:02:59 2020 UTC (6 years, 5 months ago) by adam
Branches: MAIN
CVS tags: pkgsrc-2020Q2-base, pkgsrc-2020Q2
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +3 -3 lines
py-tortoise-orm: fix typos

Revision 1.5: download - view: text, markup, annotated - select for diffs
Thu Jun 11 14:07:15 2020 UTC (6 years, 5 months ago) by adam
Branches: MAIN
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +7 -3 lines
py-tortoise-orm: updated to 0.16.13

0.16.13

Default install of tortoise-orm now installs with no C-dependencies, if you want to use the C accelerators, please do a pip install tortoise-orm[accel] instead.
Added <instance>.clone() method that will create a cloned instance in memory. To persist it you still need to call .save()
.clone() will raise a ParamsError if tortoise can’t generate a primary key. In that case do a .clone(pk=<newval>)
If manually setting the primary key value to None and the primary key can be automatically generated, this will create a new record. We however still recommend the .clone() method instead.
.save() can be forced to do a create by setting force_create=True
.save() can be forced to do an update by setting force_update=True
Setting update_fields for a .save() operation will strongly prefer to do an update if possible

Revision 1.4: download - view: text, markup, annotated - select for diffs
Sun May 31 11:38:13 2020 UTC (6 years, 5 months ago) by adam
Branches: MAIN
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +2 -2 lines
py-tortoise-orm: apparently Python 3.6 is not supported

Revision 1.3: download - view: text, markup, annotated - select for diffs
Sat May 23 20:01:55 2020 UTC (6 years, 5 months ago) by adam
Branches: MAIN
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +2 -2 lines
Re-depend on py-pypika as it has been imported

Revision 1.2: download - view: text, markup, annotated - select for diffs
Sat May 23 13:32:58 2020 UTC (6 years, 5 months ago) by jperkin
Branches: MAIN
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +2 -2 lines
py-tortoise-orm: Comment out nonexistent py-pypika.

Revision 1.1: download - view: text, markup, annotated - select for diffs
Sat May 23 08:26:18 2020 UTC (6 years, 5 months ago) by adam
Branches: MAIN
py-tortoise-orm: added version 0.16.12

Tortoise ORM is an easy-to-use asyncio ORM (Object Relational Mapper) inspired
by Django.

Tortoise ORM was build with relations in mind and admiration for the excellent
and popular Django ORM. It's engraved in it's design that you are working not
with just tables, you work with relational data.

Diff request

This form allows you to request diffs between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

Log view options

CVSweb <webmaster@jp.NetBSD.org>