(error-messages model)
(error-messages model path)
Returns the errors from the specified model. If given only a model, returns a map of all errors. If given a model and a key, returns the errors for the specified key from wihin the model.
Returns the errors from the specified model. If given only a model, returns a map of all errors. If given a model and a key, returns the errors for the specified key from wihin the model.
(flat-error-messages model)
Returns a flat list of strings describing the error messages for the model instead of the map returned by error-messages
Returns a flat list of strings describing the error messages for the model instead of the map returned by error-messages
(has-error? model)
(has-error? model path)
Returns true if the specified model contains validation errors
Returns true if the specified model contains validation errors
(valid? model)
Returns false if the model has any validation errors
Returns false if the model has any validation errors
(validate model spec)
Validates the specified model using the specified spec
Validates the specified model using the specified spec
(with-ex-validation model spec & body)
Accepts a model and validation rules. If the model passes the rules, the specified body is executed and the result returned. If not, an exception is thrown containing the error details in the ex-data.
Note that this rebinds the validated user object to the same binding used to call the macro.
Accepts a model and validation rules. If the model passes the rules, the specified body is executed and the result returned. If not, an exception is thrown containing the error details in the ex-data. Note that this rebinds the validated user object to the same binding used to call the macro.
(with-validation model spec & body)
Accepts a model and validation rules. If the model passes the rules, the specified body is executed and the result returned. If not, the invalid model, with validation errors, is returned.
Note that this rebinds the validated user object to the same binding used to call the macro.
Accepts a model and validation rules. If the model passes the rules, the specified body is executed and the result returned. If not, the invalid model, with validation errors, is returned. Note that this rebinds the validated user object to the same binding used to call the macro.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close