|
2 | 2 | History |
3 | 3 | ======= |
4 | 4 |
|
| 5 | +GINO 0.8 |
| 6 | +-------- |
| 7 | + |
| 8 | +This is also version 1.0 release candidate. |
| 9 | + |
| 10 | +Migrating to GINO 0.8 |
| 11 | +^^^^^^^^^^^^^^^^^^^^^ |
| 12 | + |
| 13 | +1. contextvars |
| 14 | +"""""""""""""" |
| 15 | + |
| 16 | +We introduced aiocontextvars_ 0.2.0 which is revamped to be compatible with |
| 17 | +PEP-567 without manual interference by a few simple implicit patches. To |
| 18 | +upgrade to GINO 0.8, please remove the ``enable_inherit()`` or |
| 19 | +``disable_inherit()`` calls, because they are the default behavior now thus |
| 20 | +no longer exist. However, you'll need to confirm that the event loop in use is |
| 21 | +always created **after** importing ``gino`` or ``aiocontextvars``, or the patch |
| 22 | +won't work correctly. |
| 23 | + |
| 24 | +There is nothing to worry about in Python 3.7. |
| 25 | + |
| 26 | +2. none_as_none |
| 27 | +""""""""""""""" |
| 28 | + |
| 29 | +When GINO tries to load a row with all ``NULL`` values into an instance, it |
| 30 | +will now by default return ``None`` instead of an instance with all ``None`` |
| 31 | +attributes. To recover the default behavior of 0.7, please specify |
| 32 | +``none_as_none(False)`` in affected model loader. |
| 33 | + |
| 34 | +This is especially applicable to relationship sub-loaders - if the sub-loader |
| 35 | +found it all ``NULL``, no instance will be set to parent instance. For |
| 36 | +example:: |
| 37 | + |
| 38 | + child = await Child.load(parent=Parent).query.gino.first() |
| 39 | + |
| 40 | +If ``child.parent_id`` is ``NULL`` in database, then the ``child`` instance |
| 41 | +won't be called with any ``setattr(child, 'parent', ...)`` at all. (If you need |
| 42 | +``child.parent == None`` in this case, consider setting default value |
| 43 | +``parent = None`` in child model.) |
| 44 | + |
| 45 | +Please note, it is deprecated to disable ``none_as_none``, and disabling will |
| 46 | +be removed in GINO 1.0. |
| 47 | + |
| 48 | +0.8.0 (2018-00-00) |
| 49 | +^^^^^^^^^^^^^^^^^^ |
| 50 | + |
| 51 | +* Welcome Tony Wang to the maintenance team (#335) |
| 52 | +* Allowed custom column names (#261 #297) |
| 53 | +* Allowed column instance in ``model.load()`` (Contributed by Jekel in #323) |
| 54 | +* [Breaking] Upgraded to aiocontextvars 0.2.0 (#333) |
| 55 | +* Fixed bug that the same empty stack is shared between sub-tasks (#313 #334) |
| 56 | +* [Breaking] Made ``none_as_none()`` the default behavior (#351) |
| 57 | +* Bug fixes and docs update |
| 58 | + |
| 59 | + |
5 | 60 | GINO 0.7 |
6 | 61 | -------- |
7 | 62 |
|
|
0 commit comments