Skip to content

Releases: tortoise/tortoise-orm

v0.16.11

14 May 06:31
Compare
Choose a tag to compare
  • fix: sqlite://:memory: in Windows thrown OSError: [WinError 123]
  • Support bulk_create() insertion of records with overridden primary key when the primary key is DB-generated
  • Add queryset.exists() and Model.exists().
  • Add model subscription lookup, Model[<pkval>] that will return the object or raise KeyError

v0.16.10

30 Apr 11:01
Compare
Choose a tag to compare
  • Fix bad import of basestring
  • Better handling of NULL characters in strings. Fixes SQLite, raises better error for PostgreSQL.
  • Support .group_by() with join now

v0.16.9

26 Apr 19:56
Compare
Choose a tag to compare
  • Support F expression in .save() now
  • IntEnumField accept valid int value and CharEnumField accept valid str value
  • Pydantic models get created with globally unique identifier
  • Leaf-detection to minimize duplicate Pydantic model creation
  • Pydantic models with a Primary Key that is also a raw field of a relation is now not hidden when exclude_raw_fields=True as it is a critically important field
  • Raise an informative error when a field is set as nullable and primary key at the same time
  • Foreign key id's are now described to have the positive-integer range of the field it is related to
  • Fixed prefetching over OneToOne relations
  • Fixed __contains for non-text fields (e.g. JSONB)

v0.16.8

22 Apr 14:04
Compare
Choose a tag to compare
  • Allow Q expression to function with _filter parameter on aggregations
  • Add manual .group_by() support
  • Fixed regression where GROUP BY class is missing for an aggregate with a specified order.

v0.15.24

22 Apr 14:03
Compare
Choose a tag to compare
  • Fixed regression where GROUP BY class is missing for an aggregate with a specified order.

v0.16.7

19 Apr 13:58
Compare
Choose a tag to compare
  • Added preliminary support for Python 3.9
  • TruncationTestCase now properly quotes table names when it clears them out.
  • Add model signals support
  • Added app_label to test initializer(...) and TORTOISE_TEST_APP as test environment variable.

v0.16.6

18 Apr 18:55
Compare
Choose a tag to compare

This is a security fix release. We strongly recommend people upgrade.

Security fixes:

  • Fixed SQL injection issue in MySQL
  • Fixed SQL injection issues in MySQL when using contains, starts_with or ends_with filters (and their case-insensitive counterparts)
  • Fixed malformed SQL for PostgreSQL and SQLite when using contains, starts_with or ends_with filters (and their case-insensitive counterparts)

Other changes:

  • Added support for partial models:

    To create a partial model, one can do a .only(<fieldnames-as-strings>) as part of the QuerySet.
    This will create model instances that only have those values fetched.

    Persisting changes on the model is allowed only when:

    • All the fields you want to update is specified in <model>.save(update_fields=[...])
    • You included the Model primary key in the `.only(...)``

    To protect against common mistakes we ensure that errors get raised:

    • If you access a field that is not specified, you will get an AttributeError.
    • If you do a <model>.save() a IncompleteInstanceError will be raised as the model is, as requested, incomplete.
    • If you do a <model>.save(update_fields=[...]) and you didn't include the primary key in the .only(...),
      then IncompleteInstanceError will be raised indicating that updates can't be done without the primary key being known.
    • If you do a <model>.save(update_fields=[...]) and one of the fields in update_fields was not in the .only(...),
      then IncompleteInstanceError as that field is not available to be updated.
  • Fixed bad SQL generation when doing a .values() query over a Foreign Key
  • Added <model>.update_from_dict({...}) that will mass update values safely from a dictionary
  • Fixed processing URL encoded password in connection string

v0.15.23

18 Apr 18:53
Compare
Choose a tag to compare

This is a security fix release. We strongly recommend everyone upgrade.

  • Fixed SQL injection issue in MySQL
  • Fixed SQL injection issues in MySQL when using contains, starts_with or ends_with filters (and their case-insensitive counterparts)
  • Fixed malformed SQL for PostgreSQL and SQLite when using contains, starts_with or ends_with filters (and their case-insensitive counterparts)

v0.16.5

10 Apr 20:24
Compare
Choose a tag to compare

Bugfixes

  • Fix for generate_schemas param being ignored in tortoise.contrib.quart.register_tortoise
  • Fix join query with source_field param

Changed

  • Moved Tortoise.describe_model(<MODEL>, ...) to <MODEL>.describe(...)
  • Deprecated Tortoise.describe_model()

v0.15.22

10 Apr 19:57
Compare
Choose a tag to compare
  • Fix the aggregates using the wrong side of the join when doing a self-referential aggregation.
  • Fix for generate_schemas param being ignored in tortoise.contrib.quart.register_tortoise