Skip to content

v0.12.3

Compare
Choose a tag to compare
@lyschoening lyschoening released this 16 Mar 10:55
· 76 commits to master since this release

Features

  • Filters are now inherited (e.g. Email and Uri work like String because they inherits from it)
  • Added filters for DateString, DateTimeString (Thanks, @boydgreenfield)
  • Implemented ItemUri.convert(). This means you can now specify filters for the "$uri" field. For more info, see below. (Thanks, @boydgreenfield)

Bugfixes

  • Fixes specifying custom filters using Meta.filters

Enabling filtering by "$uri" in a resource:

        class Meta:
            filters = {
                '$uri': {
                    None: filters.EqualFilter,
                    'eq': filters.EqualFilter,
                    'ne': filters.NotEqualFilter,
                    'in': filters.InFilter
                },
                '*': True
            }

Note that filters needs to correspond to the manager implementation you are using, e.g. flask_potion.contrib.alchemy.filters. If you want to enable the filter in multiple resources, you can use a Meta mixin.