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

Accept variations parameters with bool type hints #533

Merged

Conversation

phorward
Copy link
Member

VIUR currently allows only to pass True, yes or 1 as valid strings when a bool type hint is accepted. This is confusing, especially when true is provided, which is the valid true keyword for boolean true in the javascript word (and also many other, more professional programming languages than Python...)

VIUR currently allows only to pass True, yes or 1 as valid strings when a bool type hint is accepted. This is confusing, especially when true is provided, which is the valid true keyword for boolean true in the javascript word (and also many other, more professional programming languages than Python...)
Removing "jawoll, herr oberleutnant" and swapping strip before lower.
@phorward phorward added the refactoring Pull requests that refactor code but do not change its behavior. label Oct 26, 2022
@sveneberth
Copy link
Member

sveneberth commented Oct 26, 2022

In this context we should add the same behavior in the BooleanBone.

if str(val) in self.trueStrs:

Copy link
Member

@sveneberth sveneberth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the same behavior in the BooleanBone. Otherwise the core would be inconsistent.

@phorward phorward requested a review from sveneberth November 8, 2022 23:02
@phorward phorward merged commit c221d98 into viur-framework:develop Nov 10, 2022
@phorward phorward deleted the fix/true-for-bool-type-hints branch September 12, 2023 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Pull requests that refactor code but do not change its behavior.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants