alchy


Namealchy JSON
Version 2.2.2 PyPI version JSON
download
home_pagehttps://github.com/dgilland/alchy
SummaryA SQLAlchemy extension for its declarative ORM that provides enhancements for model classes, queries, and sessions.
upload_time2017-01-04 02:41:23
maintainer
docs_urlNone
authorDerrick Gilland
requires_python
licenseMIT License
keywords sqlalchemy databases orm declarative
VCS
bugtrack_url
requirements pydash SQLAlchemy
Travis-CI
coveralls test coverage No coveralls.
            alchy
*****

|version| |travis| |coveralls| |license|

A SQLAlchemy extension for its declarative ORM that provides enhancements for model classes, queries, and sessions.

MAINTENANCE MODE
================

**PROJECT IS IN MAINTENANCE MODE: NO NEW FEATURES, BUG FIXES ONLY**

Use `sqlservice <https://github.com/dgilland/sqlservice>`_ instead.


Links
=====

- Project: https://github.com/dgilland/alchy
- Documentation: https://alchy.readthedocs.io
- PyPi: https://pypi.python.org/pypi/alchy/
- TravisCI: https://travis-ci.org/dgilland/alchy


.. |version| image:: http://img.shields.io/pypi/v/alchy.svg?style=flat-square
    :target: https://pypi.python.org/pypi/alchy/

.. |travis| image:: http://img.shields.io/travis/dgilland/alchy/master.svg?style=flat-square
    :target: https://travis-ci.org/dgilland/alchy

.. |coveralls| image:: http://img.shields.io/coveralls/dgilland/alchy/master.svg?style=flat-square
    :target: https://coveralls.io/r/dgilland/alchy

.. |license| image:: http://img.shields.io/pypi/l/alchy.svg?style=flat-square
    :target: https://pypi.python.org/pypi/alchy/


Changelog
=========


v2.2.2 (2017-01-03)
-------------------

- Fix bug in handling of session options when providing explicit ``binds`` value via ``session_options`` during ``Manager`` in initialization. Thanks brianbruggeman_!


v2.2.1 (2016-05-18)
-------------------

- Fix bug with ``events.before_delete`` where decorator was defined using invalid parent class making it completely non-functional as a decorator.


v2.2.0 (2016-03-21)
-------------------

- Add ``metadata``argument to ``alchy.model.make_declarative_base`` to provide custom metaclass for declarative base model. Thanks fabioramponi_!


v2.1.0 (2016-03-11)
-------------------

- Add ``Meta`` argument to ``alchy.model.make_declarative_base`` to provide custom metaclass for declarative base model. Thanks elidchan_!


v2.0.1 (2015-07-29)
-------------------

- Make ``Session.get_bind()`` ``mapper`` argument have default value of ``None``.


v2.0.0 (2015-04-29)
-------------------

- Add ``Query.index_by``.
- Add ``Query.chain``.
- Add ``pydash`` as dependency and incorporate into existing ``Query`` methods: ``map``, ``reduce``, ``reduce_right``, and ``pluck``.
- Improve logic for setting ``__tablename__`` to work with all table inheritance styles (joined, single, and concrete), to handle ``@declared_attr`` columns, and not to duplicate underscore characters. Thanks sethp_!
- Modify logic that sets a Model class' ``__table_args__`` and ``__mapper_args__`` (unless overridden in subclass) by merging ``__global_table_args__`` and ``__global_mapper_args__`` from all classes in the class's ``mro()`` with ``__local_table_args__`` and ``__local_mapper_args__`` from the class itself. A ``__{global,local}_{table,mapper}_args__`` may be callable or classmethod, in which case it is evaluated on the class whose ``__{table,mapper}_args__`` is being set. Thanks sethp_! (**breaking change**)


v1.5.1 (2015-01-13)
-------------------

- Add support for callable ``__table_args__`` and ``__local_table_args__``. Thanks sethp_!


v1.5.0 (2014-12-16)
-------------------

- Add ``Model.is_modified()``. Thanks sethp_!
- Add ``Model.filter()``.
- Add ``Model.filter_by()``.


v1.4.2 (2014-11-18)
-------------------

- Add ``search.inenum`` and ``search.notinenum`` for performing an ``in_`` and ``not(in_)`` comparision using ``DeclarativeEnum``.


v1.4.1 (2014-11-17)
-------------------

- Allow ``Model.__bind_key__`` to be set at the declarative base level so that model classes can properly inherit it.


v1.4.0 (2014-11-09)
-------------------

- Make ``ModelBase``'s ``__table_args__`` and ``__mapper_args__`` inheritable via mixins. Thanks sethp_!
- Add ``__enum_args__`` to ``DeclarativeEnum``. Thanks sethp_!
- Allow enum name to be overridden when calling ``DeclarativeEnum.db_type()``. Thanks sethp_!


v1.3.1 (2014-10-14)
-------------------

- During ``Model.update()`` when setting a non-list relationship automatically instantiate ``dict`` values using the relationship model class.


v1.3.0 (2014-10-10)
-------------------

- Convert null relationships to ``{}`` when calling ``Model.to_dict()`` instead of leaving as ``None``.


v1.2.0 (2014-10-10)
-------------------

- During ``Model.update()`` when setting a list relationship automatically instantiate ``dict`` values using the relationship model class.


v1.1.2 (2014-09-25)
-------------------

- Allow ``alias`` keyword argument to ``Query.join_eager()`` and ``Query.outerjoin_eager()`` to be a ``dict`` mapping aliases to join keys. Enables nested aliases.


v1.1.1 (2014-09-01)
-------------------

- Fix handling of nested ``Model.update()`` calls to relationship attributes so that setting relationship to empty ``dict`` will propagate ``None`` to relationship attribute value correctly.


v1.1.0 (2014-08-30)
-------------------

- Add ``query.LoadOption`` to support nesting load options when calling the ``query.Query`` load methods: ``join_eager``, ``outerjoin_eager``, ``joinedload``, ``immediateload``, ``lazyload``, ``noload``, and ``subqueryload``.


v1.0.0 (2014-08-25)
-------------------

- Replace usage of ``@classproperty`` decorators in ``ModelBase`` with ``@classmethod``. Any previously defined class properties now require method access. Affected attributes are: ``session``, ``primary_key``, ``primary_keys``, ``primary_attrs``, ``attrs``, ``descriptors``, ``relationships``, ``column_attrs``, and ``columns``. (**breaking change**)
- Proxy ``getitem`` and ``setitem`` access to ``getattr`` and ``setattr`` in ``ModelBase``. Allows models to be accessed like dictionaries.
- Make ``alchy.events`` decorators class based.
- Require ``alchy.events`` decorators to be instantiated using a function call (e.g. ``@events.before_update()`` instead of ``@events.before_update``). (**breaking change**)
- Add ``alchy.search`` comparators, ``eqenum`` and ``noteqenum``, for comparing ``DeclarativeEnum`` types.


v0.13.3 (2014-07-26)
--------------------

- Fix ``utils.iterflatten()`` by calling ``iterflatten()`` instead of ``flatten`` in recursive loop.


v0.13.2 (2014-06-12)
--------------------

- Add ``ModelBase.primary_attrs`` class property that returns a list of class attributes that are primary keys.
- Use ``ModelBase.primary_attrs`` in ``QueryModel.search()`` so that it handles cases where primary keys have column names that are different than the class attribute name.


v0.13.1 (2014-06-11)
--------------------

- Modify internals of ``QueryModel.search()`` to better handle searching on a query object that already has joins and filters applied.


v0.13.0 (2014-06-03)
--------------------

- Add ``search.icontains`` and ``search.noticontains`` for case insensitive contains filter.
- Remove strict update support from ``Model.update()``. Require this to be implemented in user-land. (**breaking change**)


v0.12.0 (2014-05-18)
--------------------

- Merge originating query where clause in ``Query.search`` so that pagination works properly.
- Add ``session_class`` argument to ``Manager`` which can override the default session class used.


v0.11.3 (2014-05-05)
--------------------

- In ``ModelMeta`` when checking whether to do tablename autogeneration, tranverse all base classes when trying to determine if a primary key is defined.
- In ``ModelMeta`` set ``bind_key`` in ``__init__`` method instead of ``__new__``. This also fixes an issue where ``__table_args__`` was incorrectly assumed to always be a ``dict``.


v0.11.2 (2014-05-05)
--------------------

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


v0.11.1 (2014-05-05)
--------------------

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


v0.11.0 (2014-05-04)
--------------------

- 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.


v0.10.0 (2014-04-02)
--------------------

- 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__``.


v0.9.1 (2014-03-30)
-------------------

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


v0.9.0 (2014-03-26)
-------------------

- 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).

v0.8.0 (2014-03-18)
-------------------

- 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()``.


v0.7.0 (2014-03-13)
-------------------

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


v0.6.0 (2014-03-10)
-------------------

- 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**)


v0.5.0 (2014-03-02)
-------------------

- 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)


v0.4.2 (2014-02-24)
-------------------

- 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``).


v0.4.1 (2014-02-23)
-------------------

- 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.


v0.4.0 (2014-02-23)
-------------------

- Add ``ModelBase.save()`` method which adds model instance loaded from session to transaction.
- Add ``ModelBase.get_by()`` which proxies to ``ModelBase.query.filter_by().first()``.
- Add model attribute ``events``.
- Add support for multiple event decoration.
- Add named events for all supported events.
- Add composite events for ``before_insert_update`` and ``after_insert_update``.


v0.3.0 (2014-02-07)
-------------------

- Rename ``ModelBase.advanced_search_config`` to ``ModelBase.__advanced_search__``.
- Rename ``ModelBase.simple_search_config`` to ``ModelBase.__simple_search__``
- Add ``ModelMeta`` metaclass.
- Implement ``__tablename__`` autogeneration from class name.
- Add mapper event support via ``ModelBase.__events__`` and/or ``model.event`` decorator.


v0.2.1 (2014-02-03)
-------------------

- Fix reference to ``model.make_declarative_base`` in ``Manager`` class.


v0.2.0 (2014-02-02)
-------------------

- Add default ``query_class`` to declarative model if none defined.
- Let ``model.make_declarative_base()`` accept predefined base and just extend its functionality.


v0.1.0 (2014-02-01)
-------------------

- First release


.. _sethp: https://github.com/https://github.com/seth-p
.. _elidchan: https://github.com/elidchan
.. _fabioramponi: https://github.com/fabioramponi
.. _brianbruggeman: https://github.com/brianbruggeman



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/dgilland/alchy",
    "name": "alchy",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "sqlalchemy databases orm declarative",
    "author": "Derrick Gilland",
    "author_email": "dgilland@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/be/11/6cb2e16e3af5c988d2931b02a7faaeb408461b51fdade264a668c512bc12/alchy-2.2.2.tar.gz",
    "platform": "",
    "description": "alchy\n*****\n\n|version| |travis| |coveralls| |license|\n\nA SQLAlchemy extension for its declarative ORM that provides enhancements for model classes, queries, and sessions.\n\nMAINTENANCE MODE\n================\n\n**PROJECT IS IN MAINTENANCE MODE: NO NEW FEATURES, BUG FIXES ONLY**\n\nUse `sqlservice <https://github.com/dgilland/sqlservice>`_ instead.\n\n\nLinks\n=====\n\n- Project: https://github.com/dgilland/alchy\n- Documentation: https://alchy.readthedocs.io\n- PyPi: https://pypi.python.org/pypi/alchy/\n- TravisCI: https://travis-ci.org/dgilland/alchy\n\n\n.. |version| image:: http://img.shields.io/pypi/v/alchy.svg?style=flat-square\n    :target: https://pypi.python.org/pypi/alchy/\n\n.. |travis| image:: http://img.shields.io/travis/dgilland/alchy/master.svg?style=flat-square\n    :target: https://travis-ci.org/dgilland/alchy\n\n.. |coveralls| image:: http://img.shields.io/coveralls/dgilland/alchy/master.svg?style=flat-square\n    :target: https://coveralls.io/r/dgilland/alchy\n\n.. |license| image:: http://img.shields.io/pypi/l/alchy.svg?style=flat-square\n    :target: https://pypi.python.org/pypi/alchy/\n\n\nChangelog\n=========\n\n\nv2.2.2 (2017-01-03)\n-------------------\n\n- Fix bug in handling of session options when providing explicit ``binds`` value via ``session_options`` during ``Manager`` in initialization. Thanks brianbruggeman_!\n\n\nv2.2.1 (2016-05-18)\n-------------------\n\n- Fix bug with ``events.before_delete`` where decorator was defined using invalid parent class making it completely non-functional as a decorator.\n\n\nv2.2.0 (2016-03-21)\n-------------------\n\n- Add ``metadata``argument to ``alchy.model.make_declarative_base`` to provide custom metaclass for declarative base model. Thanks fabioramponi_!\n\n\nv2.1.0 (2016-03-11)\n-------------------\n\n- Add ``Meta`` argument to ``alchy.model.make_declarative_base`` to provide custom metaclass for declarative base model. Thanks elidchan_!\n\n\nv2.0.1 (2015-07-29)\n-------------------\n\n- Make ``Session.get_bind()`` ``mapper`` argument have default value of ``None``.\n\n\nv2.0.0 (2015-04-29)\n-------------------\n\n- Add ``Query.index_by``.\n- Add ``Query.chain``.\n- Add ``pydash`` as dependency and incorporate into existing ``Query`` methods: ``map``, ``reduce``, ``reduce_right``, and ``pluck``.\n- Improve logic for setting ``__tablename__`` to work with all table inheritance styles (joined, single, and concrete), to handle ``@declared_attr`` columns, and not to duplicate underscore characters. Thanks sethp_!\n- Modify logic that sets a Model class' ``__table_args__`` and ``__mapper_args__`` (unless overridden in subclass) by merging ``__global_table_args__`` and ``__global_mapper_args__`` from all classes in the class's ``mro()`` with ``__local_table_args__`` and ``__local_mapper_args__`` from the class itself. A ``__{global,local}_{table,mapper}_args__`` may be callable or classmethod, in which case it is evaluated on the class whose ``__{table,mapper}_args__`` is being set. Thanks sethp_! (**breaking change**)\n\n\nv1.5.1 (2015-01-13)\n-------------------\n\n- Add support for callable ``__table_args__`` and ``__local_table_args__``. Thanks sethp_!\n\n\nv1.5.0 (2014-12-16)\n-------------------\n\n- Add ``Model.is_modified()``. Thanks sethp_!\n- Add ``Model.filter()``.\n- Add ``Model.filter_by()``.\n\n\nv1.4.2 (2014-11-18)\n-------------------\n\n- Add ``search.inenum`` and ``search.notinenum`` for performing an ``in_`` and ``not(in_)`` comparision using ``DeclarativeEnum``.\n\n\nv1.4.1 (2014-11-17)\n-------------------\n\n- Allow ``Model.__bind_key__`` to be set at the declarative base level so that model classes can properly inherit it.\n\n\nv1.4.0 (2014-11-09)\n-------------------\n\n- Make ``ModelBase``'s ``__table_args__`` and ``__mapper_args__`` inheritable via mixins. Thanks sethp_!\n- Add ``__enum_args__`` to ``DeclarativeEnum``. Thanks sethp_!\n- Allow enum name to be overridden when calling ``DeclarativeEnum.db_type()``. Thanks sethp_!\n\n\nv1.3.1 (2014-10-14)\n-------------------\n\n- During ``Model.update()`` when setting a non-list relationship automatically instantiate ``dict`` values using the relationship model class.\n\n\nv1.3.0 (2014-10-10)\n-------------------\n\n- Convert null relationships to ``{}`` when calling ``Model.to_dict()`` instead of leaving as ``None``.\n\n\nv1.2.0 (2014-10-10)\n-------------------\n\n- During ``Model.update()`` when setting a list relationship automatically instantiate ``dict`` values using the relationship model class.\n\n\nv1.1.2 (2014-09-25)\n-------------------\n\n- Allow ``alias`` keyword argument to ``Query.join_eager()`` and ``Query.outerjoin_eager()`` to be a ``dict`` mapping aliases to join keys. Enables nested aliases.\n\n\nv1.1.1 (2014-09-01)\n-------------------\n\n- Fix handling of nested ``Model.update()`` calls to relationship attributes so that setting relationship to empty ``dict`` will propagate ``None`` to relationship attribute value correctly.\n\n\nv1.1.0 (2014-08-30)\n-------------------\n\n- Add ``query.LoadOption`` to support nesting load options when calling the ``query.Query`` load methods: ``join_eager``, ``outerjoin_eager``, ``joinedload``, ``immediateload``, ``lazyload``, ``noload``, and ``subqueryload``.\n\n\nv1.0.0 (2014-08-25)\n-------------------\n\n- Replace usage of ``@classproperty`` decorators in ``ModelBase`` with ``@classmethod``. Any previously defined class properties now require method access. Affected attributes are: ``session``, ``primary_key``, ``primary_keys``, ``primary_attrs``, ``attrs``, ``descriptors``, ``relationships``, ``column_attrs``, and ``columns``. (**breaking change**)\n- Proxy ``getitem`` and ``setitem`` access to ``getattr`` and ``setattr`` in ``ModelBase``. Allows models to be accessed like dictionaries.\n- Make ``alchy.events`` decorators class based.\n- Require ``alchy.events`` decorators to be instantiated using a function call (e.g. ``@events.before_update()`` instead of ``@events.before_update``). (**breaking change**)\n- Add ``alchy.search`` comparators, ``eqenum`` and ``noteqenum``, for comparing ``DeclarativeEnum`` types.\n\n\nv0.13.3 (2014-07-26)\n--------------------\n\n- Fix ``utils.iterflatten()`` by calling ``iterflatten()`` instead of ``flatten`` in recursive loop.\n\n\nv0.13.2 (2014-06-12)\n--------------------\n\n- Add ``ModelBase.primary_attrs`` class property that returns a list of class attributes that are primary keys.\n- Use ``ModelBase.primary_attrs`` in ``QueryModel.search()`` so that it handles cases where primary keys have column names that are different than the class attribute name.\n\n\nv0.13.1 (2014-06-11)\n--------------------\n\n- Modify internals of ``QueryModel.search()`` to better handle searching on a query object that already has joins and filters applied.\n\n\nv0.13.0 (2014-06-03)\n--------------------\n\n- Add ``search.icontains`` and ``search.noticontains`` for case insensitive contains filter.\n- Remove strict update support from ``Model.update()``. Require this to be implemented in user-land. (**breaking change**)\n\n\nv0.12.0 (2014-05-18)\n--------------------\n\n- Merge originating query where clause in ``Query.search`` so that pagination works properly.\n- Add ``session_class`` argument to ``Manager`` which can override the default session class used.\n\n\nv0.11.3 (2014-05-05)\n--------------------\n\n- In ``ModelMeta`` when checking whether to do tablename autogeneration, tranverse all base classes when trying to determine if a primary key is defined.\n- In ``ModelMeta`` set ``bind_key`` in ``__init__`` method instead of ``__new__``. This also fixes an issue where ``__table_args__`` was incorrectly assumed to always be a ``dict``.\n\n\nv0.11.2 (2014-05-05)\n--------------------\n\n- Support ``order_by`` as list/tuple in ``QueryModel.search()``.\n\n\nv0.11.1 (2014-05-05)\n--------------------\n\n- Fix bug in ``QueryModel.search()`` where ``order_by`` wasn't applied in the correct order. Needed to come before limit/offset are applied.\n\n\nv0.11.0 (2014-05-04)\n--------------------\n\n- PEP8 compliance with default settings.\n- Remove ``query_property`` argument from ``make_declarative_base()`` and ``extend_declarative_base()``. (**breaking change**)\n- 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).\n- Move location of class ``QueryProperty`` from ``alchy.model`` to ``alchy.query``. (**breaking change**)\n- 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**)\n- Move ``__advanced_search__`` and ``__simple_search__`` class attributes from ``ModelBase`` to ``QueryModel``. (**breaking change**)\n- 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__``.\n- 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**)\n- 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.\n- Add search operators ``any_/notany_`` and ``has/nothas`` which can be used for the corresponding relationship operators.\n\n\nv0.10.0 (2014-04-02)\n--------------------\n\n- 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.\n- Add ``alchy.search`` module which provides compatible search functions for ``ModelBase.__advanced_search__`` and ``ModelBase.__simple_search__``.\n\n\nv0.9.1 (2014-03-30)\n-------------------\n\n- Change ``ModelBase.session`` to proxy ``ModelBase.query.session``.\n- Add ``ModelBase.object_session`` proxy to ``orm.object_session(ModelBase)``.\n\n\nv0.9.0 (2014-03-26)\n-------------------\n\n- Remove ``engine_config_prefix`` argument to ``Manager()``. (**breaking change**)\n- Add explicit ``session_options`` argument to ``Manager()``. (**breaking change**)\n- Change the ``Manager.config`` options to follow Flask-SQLAlchemy. (**breaking change**)\n- Allow ``Manager.config`` to be either a ``dict``, ``class``, or ``module object``.\n- Add multiple database engine support using a single ``Manager`` instance.\n- Add ``__bind_key__`` configuration option for ``ModelBase`` for binding model to specific database bind (similar to Flask-SQLAlchemy).\n\nv0.8.0 (2014-03-18)\n-------------------\n\n- For ``ModelBase.update()`` don't nest ``update()`` calls if field attribute is a ``dict``.\n- 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**)\n- 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()``.\n\n\nv0.7.0 (2014-03-13)\n-------------------\n\n- Rename ``alchy.ManagerBase`` to ``alchy.ManagerMixin``. (**breaking change**)\n- Add ``pylint`` support.\n- Remove dependency on ``six``.\n\n\nv0.6.0 (2014-03-10)\n-------------------\n\n- 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**)\n- 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**)\n\n\nv0.5.0 (2014-03-02)\n-------------------\n\n- Add ``ModelBase.primary_key`` class property for retrieving primary key(s).\n- 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``.\n- Let any exception occurring in ``ModelBase.query`` attribute access bubble up (previously, ``UnmappedClassError`` was caught).\n- Python 2.6 and 3.3 support.\n- PEP8 compliance.\n- New dependency: ``six`` (for Python 3 support)\n\n\nv0.4.2 (2014-02-24)\n-------------------\n\n- In ``ModelBase.to_dict()`` only include fields which are mapper descriptors.\n- Support ``to_dict`` method hook when iterating over objects in ``ModelBase.to_dict()``.\n- Add ``to_dict`` method hook to ``EnumSymbol`` (propagates to ``DeclarativeEnum``).\n\n\nv0.4.1 (2014-02-23)\n-------------------\n\n- Support ``__iter__`` method in model so that ``dict(model)`` is equilvalent to ``model.to_dict()``.\n- Add ``refresh_on_empty=True`` argument to ``ModelBase.to_dict()`` which supports calling ``ModelBase.refresh()`` if ``__dict__`` is empty.\n\n\nv0.4.0 (2014-02-23)\n-------------------\n\n- Add ``ModelBase.save()`` method which adds model instance loaded from session to transaction.\n- Add ``ModelBase.get_by()`` which proxies to ``ModelBase.query.filter_by().first()``.\n- Add model attribute ``events``.\n- Add support for multiple event decoration.\n- Add named events for all supported events.\n- Add composite events for ``before_insert_update`` and ``after_insert_update``.\n\n\nv0.3.0 (2014-02-07)\n-------------------\n\n- Rename ``ModelBase.advanced_search_config`` to ``ModelBase.__advanced_search__``.\n- Rename ``ModelBase.simple_search_config`` to ``ModelBase.__simple_search__``\n- Add ``ModelMeta`` metaclass.\n- Implement ``__tablename__`` autogeneration from class name.\n- Add mapper event support via ``ModelBase.__events__`` and/or ``model.event`` decorator.\n\n\nv0.2.1 (2014-02-03)\n-------------------\n\n- Fix reference to ``model.make_declarative_base`` in ``Manager`` class.\n\n\nv0.2.0 (2014-02-02)\n-------------------\n\n- Add default ``query_class`` to declarative model if none defined.\n- Let ``model.make_declarative_base()`` accept predefined base and just extend its functionality.\n\n\nv0.1.0 (2014-02-01)\n-------------------\n\n- First release\n\n\n.. _sethp: https://github.com/https://github.com/seth-p\n.. _elidchan: https://github.com/elidchan\n.. _fabioramponi: https://github.com/fabioramponi\n.. _brianbruggeman: https://github.com/brianbruggeman\n\n\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "A SQLAlchemy extension for its declarative ORM that provides enhancements for model classes, queries, and sessions.",
    "version": "2.2.2",
    "split_keywords": [
        "sqlalchemy",
        "databases",
        "orm",
        "declarative"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "a8d0f72b5a0b002624f69d81959dd06f",
                "sha256": "5d314af6e366cc0887e88294889a24a63db8be5e25c738305650d656df2af5b0"
            },
            "downloads": -1,
            "filename": "alchy-2.2.2-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a8d0f72b5a0b002624f69d81959dd06f",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 36089,
            "upload_time": "2017-01-04T02:41:21",
            "upload_time_iso_8601": "2017-01-04T02:41:21.987509Z",
            "url": "https://files.pythonhosted.org/packages/8e/da/7ac974a65411ed0610a70977006ad68a0346762160c35d7cd463b1b2e2b5/alchy-2.2.2-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "eb4a6dc97daeefca29884bfe1420dfcb",
                "sha256": "5a3c514a35685a28453126279cac73529430dcfe5d11388dd85076c7d726f60a"
            },
            "downloads": -1,
            "filename": "alchy-2.2.2.tar.gz",
            "has_sig": false,
            "md5_digest": "eb4a6dc97daeefca29884bfe1420dfcb",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 56188,
            "upload_time": "2017-01-04T02:41:23",
            "upload_time_iso_8601": "2017-01-04T02:41:23.334471Z",
            "url": "https://files.pythonhosted.org/packages/be/11/6cb2e16e3af5c988d2931b02a7faaeb408461b51fdade264a668c512bc12/alchy-2.2.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2017-01-04 02:41:23",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "dgilland",
    "github_project": "alchy",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "pydash",
            "specs": [
                [
                    ">=",
                    "3.4.7"
                ]
            ]
        },
        {
            "name": "SQLAlchemy",
            "specs": [
                [
                    ">=",
                    "1.0.12"
                ]
            ]
        }
    ],
    "tox": true,
    "lcname": "alchy"
}
        
Elapsed time: 0.01245s