nautobot icon indicating copy to clipboard operation
nautobot copied to clipboard

[WIP] Add `__isnull` Lookup Expression via Dynamic `_null` Filter Expression

Open whitej6 opened this issue 2 years ago • 2 comments

Closes: #1905

What's Changed

  • Adds null as a filter expressions that maps to __isnull as an ORM filter

TODO

  • [ ] Explanation of Change(s)
  • [ ] Attached Screenshots, Payload Example
  • [ ] Unit, Integration Tests
  • [ ] Documentation Updates (when adding/changing features)
  • [ ] Example Plugin Updates (when adding/changing features)
  • [ ] Outline Remaining Work, Constraints from Design

whitej6 avatar Jun 17 '22 17:06 whitej6

Seems strange to me to be adding __isnull as a filter on text and numeric filters - generally speaking those type of fields shouldn't be null. I would have thought you'd want to add isnull support to ModelChoiceFilter and ModelMultipleChoiceFilter instead... is this specifically for handling custom fields without default values?

glennmatthews avatar Jun 17 '22 17:06 glennmatthews

Good catch, will look into changes needed. That was the initial source of the request.

whitej6 avatar Jun 17 '22 18:06 whitej6

Closed. Tracking stale PRs in #2812.

bryanculver avatar Nov 11 '22 20:11 bryanculver