Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor how we access ORM model configuration #366

Merged
merged 3 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Changelog
- `PR #362 <https://github.com/gtalarico/pyairtable/pull/362>`_.
* Added ORM fields that :ref:`require a non-null value <Required Values>`.
- `PR #363 <https://github.com/gtalarico/pyairtable/pull/363>`_.
* Refactored methods for accessing ORM model configuration.

2.3.3 (2024-03-22)
------------------------
Expand Down
27 changes: 25 additions & 2 deletions docs/source/migrations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,15 @@ Migration Guide
Migrating from 2.x to 3.0
============================

In this release we've made breaking changes to the :mod:`pyairtable.formulas` module.
In general, most functions and methods in this module will return instances of
In this release we've made a number of breaking changes, summarized below.

Changes to the formulas module
---------------------------------------------

Most functions and methods in :mod:`pyairtable.formulas` now return instances of
:class:`~pyairtable.formulas.Formula`, which can be chained, combined, and eventually
passed to the ``formula=`` keyword argument to methods like :meth:`~pyairtable.Table.all`.
Read the module documentation for more details.

The full list of breaking changes is below:

Expand Down Expand Up @@ -49,6 +54,24 @@ The full list of breaking changes is below:
- These no longer return ``str``, and instead return instances of
:class:`~pyairtable.formulas.FunctionCall`.

Changes to retrieving ORM model configuration
---------------------------------------------

The 3.0 release has changed the API for retrieving ORM model configuration:

.. list-table::
:header-rows: 1

* - Method in 2.x
- Method in 3.0
* - ``Model.get_api()``
- ``Model.meta.api``
* - ``Model.get_base()``
- ``Model.meta.base``
* - ``Model.get_table()``
- ``Model.meta.table``
* - ``Model._get_meta(name)``
- ``Model.meta.get(name)``

Migrating from 2.2 to 2.3
============================
Expand Down
Loading
Loading