Alchy

Latest version: v2.2.2

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

Scan your dependencies

Page 6 of 7

0.8.0

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

- For ``ModelBase.update()`` don't nest ``update()`` calls if field attribute is a ``dict``.
- Deprecated ``refresh_on_empty`` argument to ``ModelBase.to_dict()`` and instead implement ``ModelBase.__to_dict__`` configuration property as place to handle processing of model before casting to ``dict``. (**breaking change**)
- Add ``ModelBase.__to_dict__`` configuration property which handles preprocessing for model instance and returns a set of fields as strings to be used as dict keys when calling ``to_dict()``.

0.7.0

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

- Rename ``alchy.ManagerBase`` to ``alchy.ManagerMixin``. (**breaking change**)
- Add ``pylint`` support.
- Remove dependency on ``six``.

0.6.0

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

- Prefix event decorators which did not start with ``before_`` or ``after_`` with ``on_``. Specifically, ``on_set``, ``on_append``, ``on_remove``, ``on_append_result``, ``on_create_instance``, ``on_instrument_class``, ``on_mapper_configured``, ``on_populate_instance``, ``on_translate_row``, ``on_expire``, ``on_load``, and ``on_refresh``. (**breaking change**)
- Remove lazy engine/session initialization in ``Manager``. Require that ``Model`` and ``config`` be passed in at init time. While this removes some functionality, it's done to simplify the ``Manager`` code so that it's more straightforward. If lazy initialization is needed, then a proxy class should be used. (**breaking change**)

0.5.0

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

- Add ``ModelBase.primary_key`` class property for retrieving primary key(s).
- Add ``Base=None`` argument to ``make_declarative_base()`` to support passing in a subclass of ``ModelBase``. Previously had to create a declarative ``Model`` to pass in a subclassed ``ModelBase``.
- Let any exception occurring in ``ModelBase.query`` attribute access bubble up (previously, ``UnmappedClassError`` was caught).
- Python 2.6 and 3.3 support.
- PEP8 compliance.
- New dependency: ``six`` (for Python 3 support)

0.4.2

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

- In ``ModelBase.to_dict()`` only include fields which are mapper descriptors.
- Support ``to_dict`` method hook when iterating over objects in ``ModelBase.to_dict()``.
- Add ``to_dict`` method hook to ``EnumSymbol`` (propagates to ``DeclarativeEnum``).

0.4.1

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

- Support ``__iter__`` method in model so that ``dict(model)`` is equilvalent to ``model.to_dict()``.
- Add ``refresh_on_empty=True`` argument to ``ModelBase.to_dict()`` which supports calling ``ModelBase.refresh()`` if ``__dict__`` is empty.

Page 6 of 7

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.