backbone-validator icon indicating copy to clipboard operation
backbone-validator copied to clipboard

Address issue #28: introduce "star validation" for freeform validating

Open taivo opened this issue 11 years ago • 3 comments

See issue #28.

taivo avatar Jul 21 '14 06:07 taivo

@taivo would you have an example of this in use?

chikamichi avatar Nov 27 '14 18:11 chikamichi

@chikamichi , at the time of those checkins, my main usecase was for Parse.com's Parse.Object. Parse.com is a mobile backend that builds upon an older fork of Backbone so their Parse.Object is essentially Backbone.Model with a few customizations like the Parse.Object.validate() method that checks a few special fields. For my usecase, I wanted a way to call the prebuilt validate function with backbone-validator As I understood it, backbone-validator automates validation work for individual fields but doesn't have an explicit mechanism to validate relationships among fields, e.g., requires minVal <= maxVal. In my previous life, I was a Django developer so my thinking regarding validation is somewhat inline with that framework: individual fields are validated, then the model as a whole is also validated. To use this, just specify '*' as a key in your validation specs, and a function as the value.

taivo avatar Dec 01 '14 07:12 taivo

Ok, it makes sense. I must say I like it. :+1: from a user.

chikamichi avatar Dec 02 '14 17:12 chikamichi