Skip to content

Filter validation too rigid for filters with suffixes #938

@SafaAlfulaij

Description

@SafaAlfulaij

Here:

if (not filterset_class) or (k not in filterset_class.base_filters):

RangeFilter is used to specify a value of the two ends without specifying the other. It works by looking for "min/after" and "max/before" in the query param.

This should work:

Using DateFromToRangeFilter, defined this way:

last_updated = DateFromToRangeFilter()

and passing the filter:
filters[last_updated_after]=2016-01-01

will execute: .filter(last_updated__gte="2016-01-01")

Currently it fails as last_updated_after != last_updated (as in the quoted code: base_filters contains last_updated but not last_updated_after or last_updated_before)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy