Open vincentwhales opened 7 years ago
I am having the exact same problem right now.
This still doesn't work properly.
The help at https://wtforms-alchemy.readthedocs.io/en/latest/validators.html is confusing (and grammatically incorrect).
It looks like the PR submitted by @GregoryVigoTorres was either closed before merging, or did not properly address this particular issue.
Can we get some guidance on how updating records with validators that require uniqueness of row entries are supposed to work?
I second this. It should be a rather straight forward thing to update an existing entry. The provided Information does not work.
It happens quite often that a table with a unique value exists and needs to get changed, this could be more straightforward. But functioning or accurate documentation would be a good step.
edit: sorry was having a hickup. I validated BEFORE populating the obj.
I have the following class:
(Note the unique=True for domain)
With a form generated by WTForm:
I have the following code which handles CRUD for this model:
When I update an object, I am consistently getting
Already exists.
for domain.When I follow Using unique validator with existing objects on wtforms-alchemy's website:
I am getting
This field is required.
for domain. I don't understand how WTForms-Alchemy is getting their data from request.form if I follow their recommendations.How can I get unique=True to work with my views?