Peewee v3.5.0 Release Notes

  • Backwards-incompatible changes

    • Custom Model repr no longer use the convention of overriding __unicode__, and now use __str__.
    • โœ… Redesigned the sqlite json1 integration. and changed some of the APIs and semantics of various JSONField methods. The documentation has been expanded to include more examples and the API has been simplified to make it easier to work with. These changes do not have any effect on the Postgresql JSON fields.

    ๐Ÿ†• New features

    • ๐Ÿ‘ Better default repr for model classes and fields.
    • ForeignKeyField() accepts a new initialization parameter, deferrable, for specifying when constraints should be enforced.
    • BitField.flag() can be called without a value parameter for the common use-case of using flags that are powers-of-2.
    • SqliteDatabase pragmas can be specified as a dict (previously required a list of 2-tuples).
    • โœ… SQLite TableFunction (docs) will print Python exception tracebacks raised in the initialize and iterate callbacks, making debugging significantly easier.

    ๐Ÿ› Bug fixes

    • ๐Ÿ›  Fixed bug in migrator.add_column() where, if the field being added declared a non-standard index type (e.g., binary json field with GIN index), this index type was not being respected.
    • ๐Ÿ›  Fixed bug in database.table_exists() where the implementation did not match the documentation. Implementation has been updated to match the documentation.
    • ๐Ÿ›  Fixed bug in SQLite TableFunction implementation which raised errors if the return value of the iterate() method was not a tuple.

    View commits