-
Notifications
You must be signed in to change notification settings - Fork 123
Missing support for boolean field or examples of how to do it #193
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
Comments
Hi there - boolean fields aren't yet supported for JSON or Hash, they'll likely appear in JSON first as boolean is a native type there vs a Redis Hash that understands strings, floats and ints. |
I'm talking to the maintainers of the other Redis OM Clients for different languages to make sure that when we do add booleans to Python there's a common approach where possible. |
@simonprickett , any update on native support for boolean fields? |
Hey! Is there maybe a way to include it in the hash and have the library convert and store it as an integer behind the scenes? It would be super helpful to work with booleans in these cases instead of requiring users to pass integers directly. |
I have a model like
MyModel(HashModel): local_auth: bool
When initing or saving I get:
DataError("Invalid input of type: 'bool'. Convert to a bytes, string, int or float first.")
The text was updated successfully, but these errors were encountered: