Skip to content

Discern between default value and provided value for None as a query parameter #2084

@Subaku

Description

@Subaku

Hello,

I've got a use case that sometimes comes up. When filtering my DB querying for "null" from the client on a particular field is a valid thing to do. This of course translates to None. Problem is most of the time query parameters of optional for me. How might I determine which None I'm dealing with? I.e. did the client explicitly provide the parameter or was it missing and None was set as the default.

From similar issues I'm thinking that maybe some kind of middleware to determine if I actually passed a value or not might be in order but wanted to see if I'm missing something elegant.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions