Alchy

Latest version: v2.2.2

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

Scan your dependencies

Page 5 of 7

0.11.2

--------------------

- Support ``order_by`` as list/tuple in ``QueryModel.search()``.

0.11.1

--------------------

- Fix bug in ``QueryModel.search()`` where ``order_by`` wasn't applied in the correct order. Needed to come before limit/offset are applied.

0.11.0

--------------------

- PEP8 compliance with default settings.
- Remove ``query_property`` argument from ``make_declarative_base()`` and ``extend_declarative_base()``. (**breaking change**)
- Add ``ModelBase.primary_keys`` class property which returns a tuple always (``ModelBase.primary_key`` returns a single key if only one present or a tuple if multiple).
- Move location of class ``QueryProperty`` from ``alchy.model`` to ``alchy.query``. (**breaking change**)
- Create new ``Query`` subclass named ``QueryModel`` which is to be used within a query property context. Replace ``Query`` with ``QueryModel`` as default query class. (**breaking change**)
- Move ``__advanced_search__`` and ``__simple_search__`` class attributes from ``ModelBase`` to ``QueryModel``. (**breaking change**)
- Introduce ``QueryModel.__search_filters__`` which can define a canonical set of search filters which can then be referenced in the list version of ``__advanced_search__`` and ``__simple_search__``.
- Modify the logic of ``QueryModel.search()`` to use a subquery joined onto the originating query in order to support pagination when one-to-many and many-to-many joins are present on the originating query. (**breaking change**)
- Support passing in a callable that returns a column attribute for ``alchy.search.<method>()``. Allows for ``alchy.search.contains(lambda: Foo.id)`` to be used at the class attribute level when ``Foo.id`` will be defined later.
- Add search operators ``any_/notany_`` and ``has/nothas`` which can be used for the corresponding relationship operators.

0.10.0

--------------------

- Issue warning instead of failing when installed version of SQLAlchemy isn't compatible with ``alchy.Query``'s loading API (i.e. missing ``sqlalchemy.orm.strategy_options.Load``). This allows ``alchy`` to be used with earlier versions of SQLAlchemy at user's own risk.
- Add ``alchy.search`` module which provides compatible search functions for ``ModelBase.__advanced_search__`` and ``ModelBase.__simple_search__``.

0.9.1

-------------------

- Change ``ModelBase.session`` to proxy ``ModelBase.query.session``.
- Add ``ModelBase.object_session`` proxy to ``orm.object_session(ModelBase)``.

0.9.0

-------------------

- Remove ``engine_config_prefix`` argument to ``Manager()``. (**breaking change**)
- Add explicit ``session_options`` argument to ``Manager()``. (**breaking change**)
- Change the ``Manager.config`` options to follow Flask-SQLAlchemy. (**breaking change**)
- Allow ``Manager.config`` to be either a ``dict``, ``class``, or ``module object``.
- Add multiple database engine support using a single ``Manager`` instance.
- Add ``__bind_key__`` configuration option for ``ModelBase`` for binding model to specific database bind (similar to Flask-SQLAlchemy).

Page 5 of 7

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.