Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is NULL should have value "True", not "None" #119

Closed
PeterTillema opened this issue May 27, 2020 · 2 comments · Fixed by #178 · May be fixed by #120
Closed

Is NULL should have value "True", not "None" #119

PeterTillema opened this issue May 27, 2020 · 2 comments · Fixed by #178 · May be fixed by #120

Comments

@PeterTillema
Copy link

PeterTillema commented May 27, 2020

Describe the bug
If you have a field which should be null, i.e. type "Is NULL", no matter what you select as the key (which should be something, it can't empty, huh?), the key gets replaced with "null" which translates to Python with "None", rather than "true", which becomes "True" in Django, and that is what we want.

See https://docs.djangoproject.com/en/3.0/ref/models/querysets/#isnull for more information.

I think this is the issue:

if formdata['operator'] == "isnull":
return {key: None}

@eriktelepovsky
Copy link

+1

When I use "isnull" lookup on foreign field, I get Cannot use None as a query value. It should be True instead.

@eriktelepovsky
Copy link

@PeterTillema your fix is not enough but thank you for pointing me. I created PR which solves the issue correctly: #156

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants