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

Correct handling of boolean field types in utils.py #104

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Correct handling of boolean field types in utils.py #104

wants to merge 1 commit into from

Conversation

wcalvert
Copy link

@wcalvert wcalvert commented Nov 3, 2013

I believe there's a small bug in the function get_model_from_dictionary. When a value of "False" is assigned to a field of type BooleanField, it was getting converted to True. This is probably because in Python, bool("False") converts to True.

@coleifer
Copy link
Owner

coleifer commented Nov 4, 2013

This assumes you are serializing your boolean fields using 'True' and 'False' I guess?

@wcalvert
Copy link
Author

wcalvert commented Nov 4, 2013

That's correct. I shouldn't have used the word "bug" because it's really only related to cases of 'True' or 'False' and not True or False.

@loleg
Copy link

loleg commented Apr 15, 2014

I am unable to correctly filter boolean fields on both 0.6.5 and master through the REST API, applying this patch did not seem to fix the issue, but I have a feeling it's a related problem. Anything in the __ne filter gives no results, and the __eq filter does not have any effect.

@antback
Copy link

antback commented Apr 29, 2014

I'm suffering this bug, too. In my model class, the field is defined as BooleanField() and in the database MySQL is defined as tinyint(1). Any filter by this field using the REST api is ignored as allways put 1 in the query.

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

Successfully merging this pull request may close these issues.

4 participants