Skip to content

0.11-2018-07-15

Compare
Choose a tag to compare
@barseghyanartur barseghyanartur released this 15 Jul 02:28
· 438 commits to master since this release

2018-07-15

.. note::

This release contains backwards incompatible changes.
You should update your Django code and front-end parts of your applications
that were relying on the complex queries using `|` and `:` chars in the
GET params.

.. note::

If you have used custom filter backends using `SEPARATOR_LOOKUP_VALUE`
`SEPARATOR_LOOKUP_COMPLEX_VALUE` or
`SEPARATOR_LOOKUP_COMPLEX_MULTIPLE_VALUE` constants or
`split_lookup_complex_value` helper method of the `FilterBackendMixin`,
you most likely want to run your functional tests to see if everything
still works.

.. note::

Do not keep things as they were in your own fork, since new search backends
will use the `|` and `:` symbols differently.

Examples of old API requests vs new API requests

.. note::

Note, that `|` and `:` chars were mostly replaced with `__` and `,`.

Old API requests

.. code-block:: text

http://127.0.0.1:8080/search/publisher/?search=name|reilly&search=city|london
http://127.0.0.1:8000/search/publishers/?location__geo_distance=100000km|12.04|-63.93
http://localhost:8000/api/articles/?id__terms=1|2|3
http://localhost:8000/api/users/?age__range=16|67|2.0
http://localhost:8000/api/articles/?id__in=1|2|3
http://localhost:8000/api/articles/?location__geo_polygon=40,-70|30,-80|20,-90|_name:myname|validation_method:IGNORE_MALFORMED

New API requests

.. code-block:: text

http://127.0.0.1:8080/search/publisher/?search=name:reilly&search=city:london
http://127.0.0.1:8000/search/publishers/?location__geo_distance=100000km__12.04__-63.93
http://localhost:8000/api/articles/?id__terms=1__2__3
http://localhost:8000/api/users/?age__range=16__67__2.0
http://localhost:8000/api/articles/?id__in=1__2__3
http://localhost:8000/api/articles/?location__geo_polygon=40,-70__30,-80__20,-90___name,myname__validation_method,IGNORE_MALFORMED
  • SEPARATOR_LOOKUP_VALUE has been removed. Use
    SEPARATOR_LOOKUP_COMPLEX_VALUE and
    SEPARATOR_LOOKUP_COMPLEX_MULTIPLE_VALUE instead.
  • SEPARATOR_LOOKUP_NAME has been added.
  • The method split_lookup_complex_value has been removed. Use
    split_lookup_complex_value instead.
  • Default filter lookup option is added. In past, if no specific lookup was
    provided and there were multiple values for a single field to filter on, by
    default terms filter was used. The term lookup was used by default
    in similar situation for a single value to filter on. It's now possible to
    declare default lookup which will be used when no lookup is given.
  • Removed deprecated views module. Import from viewsets instead.
  • Removed undocumented get_count helper from helpers module.