Skip to content

Releases: tortoise/tortoise-orm

0.15.11

10 Feb 19:14
f277a70
Compare
Choose a tag to compare
  • Added ordering option for model Meta class to apply default ordering (#288)

v0.15.10

10 Feb 09:25
Compare
Choose a tag to compare
  • Bumped requirements to cater for newer feature use (#282)

v0.15.9

19 Jan 06:53
Compare
Choose a tag to compare
  • Alias Foreign Key joins as we can have both self-referencing and duplicate joins to the same table.
    This generates SQL that differentiates between which instance of the table to work with. (#275)

v0.15.8

17 Jan 19:41
Compare
Choose a tag to compare
  • TextField now recommends usage of CharField if wanting unique indexing instead of just saying "indexing not supported"
  • .count() now honours offset and limit (#167)
  • Testing un-awaited ForeignKeyField as a boolean expression will automatically resolve as False if it is None (#274)
  • Awaiting a nullable ForeignKeyField won't touch the DB if it is None (#274)

v0.15.7

28 Dec 05:24
Compare
Choose a tag to compare
  • QuerySet.Update() now returns the count of the no of rows affected. Note, that
  • QuerySet.Delete() now returns the count of the no of rows deleted.
  • Note that internal API of db_connection.execute_query() now returns rows_affected, results. (This is informational only)
  • Added get_or_none(...) as syntactic sugar for filter(...).first()

v0.15.6

28 Dec 05:24
Compare
Choose a tag to compare
  • Added BinaryField for storing binary objects (bytes).
  • Changed TextField to use LONGTEXT for MySQL to allow for larger than 64KB of text.
  • De-duplicate index if specified on both index=true and as part of indexes
  • Primary Keyed TextField is marked as deprecated.
    We can't guarnatee that it will be properly indexed or unique in all cases.
  • One can now disable the backwards relation for FK/O2O relations by passing related_name=False
  • One can now pass a PK value to a generated field, and Tortoise ORM will use that as the PK as expected.
    This allows one to have a model that has a autonumber PK, but setting it explicitly if required.

v0.15.5

28 Dec 05:23
Compare
Choose a tag to compare
  • Refactored Fields:

    Fields have been refactored, for better maintenance. There should be no change for most users.

    • More accurate auto-completion.
    • Fields now contain their own SQL schema by dialect, which significantly simplifies adding field types.
    • describe_model() now returns the DB type, and dialect overrides.
  • JSONField will now automatically use python-rapidjson as an accelerator if it is available.
  • DecimalField and aggregations on it, now behaves much more like expected on SQLite (#256)
  • Check whether charset name is valid for the MySQL connection (#261)
  • Default DB driver parameters are now applied consistently, if you use the URI schema or manual.

v0.15.4

02 Dec 21:07
Compare
Choose a tag to compare
  • Don't generate a schema if there is no models (#254)
  • Emit a RuntimeWarning when a module has no models to import (#254)
  • Allow passing in a custom SSL context (#255)

0.15.3

28 Nov 06:46
Compare
Choose a tag to compare
  • Added OneToOneField implementation:

    OneToOneField describes a one to one relation between two models.
    It can be set from the primary side only, but resolved from both sides in the same way.

    describe_model(...) now also reports OneToOne relations in both directions.

    Usage example:

     event: fields.OneToOneRelation[Event] = fields.OneToOneField(
         "models.Event", on_delete=fields.CASCADE, related_name="address"
     )
  • Prefetching is done concurrently now, sending all prefetch requests at the same time instead of in sequence.
  • Enabe foreign key enforcement on SQLite for builds where it was optional.

v0.15.2

27 Nov 16:01
Compare
Choose a tag to compare
  • The auto_now_add argument of DatetimeField is handled correctly in the SQLite backend. (#248)
  • unique_together now creates named constrains, to prevent the DB from auto-assigning a potentially non-unique constraint name. (#237)
  • Filtering by an auto_now field doesn't replace the filter value with now() anymore. (#249)