------ * Moved ``Tortoise.describe_model(<MODEL>, ...)`` to ``<MODEL>.describe(...)`` * Deprecated ``Tortoise.describe_model()`` * Fix for ``generate_schemas`` param being ignored in ``tortoise.contrib.quart.register_tortoise`` * Fix join query with `source_field` param
0.16.4
Not secure
------ * More consistent escaping of db columns, fixes using SQL reserved keywords as field names with a function. * Fix the aggregates using the wrong side of the join when doing a self-referential aggregation. * Fix ``F`` functions wrapped forgetting about ``distinct=True``
0.16.3
Not secure
------ * Fixed invalid ``var IN ()`` SQL generated using ``__in=`` and ``__not_in`` filters. * Fix bug with order_by on nested fields * Fix joining with self by reverse-foreign-key for filtering and annotation
0.16.2
Not secure
------ * Default ``values()`` & ``values_list()`` now includes annotations. * Annotations over joins now work correctly with ``values()`` & ``values_list()`` * Ensure ``GROUP BY`` precedes ``HAVING`` to ensure that filtering by aggregates work correctly. * Fix bug with join query with aggregation * Cast ``BooleanField`` values correctly on SQLite & MySQL
0.16.1
Not secure
------ * ``QuerySetSingle`` now has better code completion * Created Pydantic models will now have the basic validation elements:
* ``required`` is correctly populated for required fields * ``nullable`` is added to the schema where nulls are accepted * ``maxLength`` for CharFields * ``minimum`` & ``maximum`` values for integer fields
To get Pydantic to handle nullable/default fields correctly one should do a ``**user.dict(exclude_unset=True)`` when passing values to a Model class.
* Added ``FastAPI`` helper that is based on the ``starlette`` helper but optionally adds helpers to catch and report with proper error ``DoesNotExist`` and ``IntegrityError`` Tortoise exceptions. * Allows a Pydantic model to exclude all read-only fields by setting ``exclude_readonly=True`` when calling ``pydantic_model_creator``. * a Tortoise ``PydanticModel`` now provides two extra helper functions:
* ``from_queryset``: Returns a ``List[PydanticModel]`` which is the format that e.g. FastAPI expects * ``from_queryset_single``: allows one to avoid calling ``await`` multiple times to get the object and all its related items.