Modified form validation#527
Conversation
|
Thanks for this PR!
Nice catch, I think it makes sense to support this.
Yeah, that was by design to enable more iterative workflows that use forms. For example, consider a form with 2 fields. If the form is validated on blur then the second field will be considered invalid after the first one is filled in. I am concerned this functionality is confusing and/or differs too much from Django semantics, though. I wonder if there could be a way support both approaches? Maybe with a new magic keyword like |
|
I add the possibility to declare in UnicornView a special attribute called 'validate_all', if it is set to true value it validates the entire form, otherwise it validates only the fields that have been changed by the user. |
Hi, I was trying to use unicorn form validation with a model that has the
unique_togethermodel's Meta option.Unicorn validation didn't validate this option. I saw your validation code and i noted two things:
unique_togetheroption or other types of validations that work on more than one fields of model error messages are indexed by Django with key called__all__and with existing validation this field was never readI fixed this two problems with the code that i modified in this pull request. I tried to run your tests and they didn't pass, i saw that this happens because the tests didn't enter in old code but now the tests enter and they don't pass. I haven't changed the tests.
Probably you need to change the documentation and tests if you merge this pull request