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

Columns with a default value should not be required #48

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

Conversation

smsearcy
Copy link

If a column has a default value, then make the input field optional when generating a form object from a model.

This enables the defaults in the table definition to allow for empty string in a text field and an unchecked checkbox to be submitted.

Closes #47

If a column has a default value, then make the input field optional when
generating a form object from a model.
@smsearcy
Copy link
Author

smsearcy commented May 10, 2024

I just realized I did not test the scenario in which the default value of a boolean column is True. That might require some special handling for the checkboxes, unless WTForms already handles that somehow.

Edit: I verified that a boolean column with default=True will store False to the database.

@smsearcy smsearcy marked this pull request as draft May 10, 2024 17:51
@smsearcy smsearcy marked this pull request as ready for review May 10, 2024 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Non-nullable columns with a default value should be optional
1 participant