-
Notifications
You must be signed in to change notification settings - Fork 14
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
fix: Add check for callable
in BooleanBone
#1179
fix: Add check for callable
in BooleanBone
#1179
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's not really useful. A callable defaultValue
should be called at runtime:
viur-core/src/viur/core/bones/base.py
Line 358 in 40d4e82
return self.defaultValue(skeletonInstance, self) |
otherwise I could BooleanBone(defaultValue=my_func())
directly ...
Yes, you are right. The whole thing with the default value needs to be revised... . I don't know if we should wait for #1154. Or is it enough to allow callables for now? |
Is okay my_bone = BooleanBone(...)
my_bone.defaultValue = lambda skel, bone: ... does the job for now too |
Ok,what's with this PR now? It's still flagged for ViUR-core 3.6. Can we close it? |
As it's not really solving the problem and it's possible to workaround with a monkey patch I would recommend to close this too and wait for 3.7. |
Fix for #1178