vantage6.client.filter.post_filtering#

post_filtering(iterable=True)#

Decorator to add filtering of dictornaries from the result.

Depending on whether this is a list of or a single dictionairy, the decorator adds the arguments field, fields, filter, filters.

This is a wrapper for the other decorators. Note that the order of filter_keys_from_results and filter_dicts_from_results is important as you do want to first select the dicts that you need and then filter their keys. This way you can filter on key-value pairs that you do not want in your output.

Parameters:

iterable (bool, optional) – Whether the result is a list of dicts or a single dict, by default True

Returns:

The original function with the added decorators that filter the output of the function by specified fields and keys.

Return type:

callable