boolean field always ask for true value
When I create a boolean field, it will not accept the form unless I set it to TRUE.
Obviously, please set required=False according to the Django docs
actually, I'm aware that you can set required=false; however the example project does not accept the boolean field unless its value entered is true, making the example project not functioning correctly unless the user edits the project.
Ah, that sounds legit.
I have a similar issue. Boolean fields always require to be ticked for the form to submit. In the code I discovered this:
@dynamic_form_field
class BooleanField(BaseDynamicFormField):
cls = 'django.forms.BooleanField'
display_label = _('Boolean')
class Meta:
_exclude = ('required',)
Removing the Meta completely fixes the issue because I can decide on my own if the field is required to be ticked or can be left blank. Now I don't really understand why that exclude was added and would suggest to remove it.
Do you want to provide a pull request + patch for that? Happy to review it :smile:
after thinking about a use case; I think it's right the way it's right now.
Example,
a form may have boolean at end of the form for the following question
check here X to accept the agreement; the checkbox must be True for the form to be submitted successfully, therefore, in this case, the developer sets this booleanfield as required. and it should only be accepted if it's value is True, the same as current behavior