Flask-marshmallow

Latest version: v1.2.1

Safety actively analyzes 629994 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 4

0.13.0

*******************

Bug fixes:

* Fix compatibility with marshmallow-sqlalchemy<0.22.0 (:issue:`189`).
Thanks :user:`PatrickRic` for reporting.

Other changes:

* Remove unused ``flask_marshmallow.sqla.SchemaOpts``.

0.12.0

*******************

* *Breaking change*: ``ma.ModelSchema`` and ``ma.TableSchema`` are removed, since these are deprecated upstream.

.. warning::
It is highly recommended that you use the newer ``ma.SQLAlchemySchema`` and ``ma.SQLAlchemyAutoSchema`` classes
instead of ``ModelSchema`` and ``TableSchema``. See the release notes for `marshmallow-sqlalchemy 0.22.0 <https://marshmallow-sqlalchemy.readthedocs.io/en/latest/changelog.html>`_
for instructions on how to migrate.

If you need to use ``ModelSchema`` and ``TableSchema`` for the time being, you'll need to import these directly from ``marshmallow_sqlalchemy``.

.. code-block:: python

from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_marshmallow import Marshmallow

app = Flask(__name__)
app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:////tmp/test.db"

db = SQLAlchemy(app)
ma = Marshmallow(app)

flask-marshmallow<0.12.0


class AuthorSchema(ma.ModelSchema):
class Meta:
model = Author


flask-marshmallow>=0.12.0 (recommended)


class AuthorSchema(ma.SQLAlchemyAutoSchema):
class Meta:
model = Author
load_instance = True


flask-marshmallow>=0.12.0 (not recommended)

from marshmallow_sqlalchemy import ModelSchema


class AuthorSchema(ModelSchema):
class Meta:
model = Author
sql_session = db.session

Bug fixes:

* Fix binding Flask-SQLAlchemy's scoped session to ``ma.SQLAlchemySchema`` and ``ma.SQLAlchemyAutoSchema``.
(:issue:`180`). Thanks :user:`fnalonso` for reporting.

0.11.0

*******************

Features:

* Add support for ``SQLAlchemySchema``, ``SQLAlchemyAutoSchema``, and ``auto_field``
from marshmallow-sqlalchemy>=0.22.0 (:pr:`166`).

Bug fixes:

* Properly restrict marshmallow-sqlalchemy version based on Python version (:pr:`158`).

Other changes:

* Test against Python 3.8.

0.10.1

*******************

Bug fixes:

* marshmallow 3.0.0rc6 compatibility (:pr:`134`).

0.10.0

*******************

Features:

* Add `ma.TableSchema` (:pr:`124`).
* SQLAlchemy requirements can be installed with ``pip install
'flask-marshmallow[sqlalchemy]'``.


Bug fixes:

* ``URLFor``, ``AbsoluteURLFor``, and ``HyperlinkRelated`` serialize to ``None`` if a passed attribute value is ``None`` (:issue:`18`, :issue:`68`, :pr:`72`).
Thanks :user:`RobinRamuel`, :user:`ocervell`, and :user:`feigner` for reporting.

Support:

* Test against Python 3.7.
* Drop support for Python 3.4. Only Python 2.7 and >=3.5 are supported.

0.9.0

******************

* Add support for marshmallow 3 beta. Thanks :user:`SBillion` for the PR.
* Drop support for Python 3.3. Only Python 2.7 and >=3.4 are supported.
* Updated documentation to fix example ``ma.URLFor`` target.

Page 2 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.