-----
* Improvements in testing support:
* ``AutomationCommands`` now uses yield to generate the sequence of opcodes and their args, resulting in cleaner code.
* ``SeleniumCommands`` is reworked into ``BaseSeleniumCommands``. It supports:
* Saving current database state to Django fixtures at the particular points of tests via `dump_data`_ command. That
allows to skip already debugged parts of tests via `.has_fixture()`_ method, greatly reducing the time
required to develop and debug long running Selenium tests. To make proper order (sequence) of stored / loaded
fixtures, one has to define `fixtures_order`_ attribute of ``DjkTestCase`` derived class.
* Automatic retry of the last Selenium commands execution in case current command is timed out when running at
slow client due to DOM is not being updated in time.
* css parsing / xpath string escaping.
* ``SeleniumQueryCommands`` implements generic Selenium commands, including Django reverse url support for navigation
bar, anchors and forms, which could be useful in any Django application.
* ``DjkSeleniumQueryCommands`` implements additional Selenium commands related to django-jinja-knockout functionality,
such as BootstrapDialog and Knockout.js grids / widgets support.
forms.py
~~~~~~~~
* ``BootstrapModelForm`` always populates ``.request`` attribute for convenience.
* ``CustomFullClean`` / ``StripWhitespaceMixin`` mixins for Django forms.
middleware.py
~~~~~~~~~~~~~
* ``ContextMiddleware`` class:
* Supports request mocking when running not under HTTP server, for example as shell command / celery task.
* Supports request-time storage of lists / dicts of objects via `add_instance`_ / `yield_out_instances`_ methods.
query.py
~~~~~~~~
* `FilteredRawQuerySet`_ supports Q expressions (Q objects) with relation mapping.
views submodule
~~~~~~~~~~~~~~~
* ``BaseFilterView``
* ``filter_queryset()`` now supports args in addition to kwargs. That allows to use Django ``Q`` objects in grids
and lists, although actual generation of ``Q`` objects is still limited to ``None`` value filtering.
* ``None`` can be valid value of field filter query. It is mapped to ``is_null`` field lookup, also it uses Django
``Q.__or__`` operation in case ``None`` is presented in the list of field filter values.
* Query filters now support ``in`` clause for drop-down ``choice`` filter.
widgets.py
~~~~~~~~~~
* ``DisplayText`` field widget ``__init__()`` method now supports two types of ``get_text`` callback arguments:
* ``get_text_method`` which binds passed function to DisplayText widget instance (self as first argument)
* ``get_text_fn`` which uses unbound function (no self).
If form that defined widget uses ``WidgetInstancesMixin`` and model field instance has ``get_str_fields()`` method
implemented, such field will be auto-rendered via ``print_list_group()`` / ``print_bs_well()`` functions of ``tpl``
module to produce structured output.
ko_grid_body.htm
~~~~~~~~~~~~~~~~
* Fixed ``ko_grid_body()`` macro not including underscore.js templates copied with different ``template_id`` when these
templates were called from related underscore.js templates.
grid.js
~~~~~~~
* Reset filter now uses ``undefined`` value instead of ``null`` value because filtering by ``None`` value is now
supported in `KoGridView`_.
* ``App.ko.GridRow`` class ``display()`` method now automatically picks nested relation value from nested ``strFields``
value, when available. That allows to traverse nested ``get_str_fields()`` values automatically.
See ``getDisplayValue()`` method for the implementation.
* Allow to click nested elements of row cells when these are enclosed into anchors.
* Allow to override grid callback action via viewmodel ``callback_action`` property.
* Query filters now support multi-value ``in`` clause for values of drop-down ``choice`` filter.
* Grid viewmodel ``deleted_pks`` key values are processed first in ``App.ko.Grid.updatePage()``. That allows to delete
old row and add new row with the same ``pkVal`` at once (forced update).
* ``App.ko.Grid`` class ``.setFiltersChoices()`` method simplifies programmatic filtering of grid at client-side, for
example from the parsed querystring.
plugins.js
~~~~~~~~~~
``$.linkPreview`` now has separate inclusion filter for local urls and exclusion filter for remote urls, which minimizes
the possibility of preview glitches due to wrong guess of resource type.