On 31 May 2009, at 05:46, macario wrote:
I am toying with document validation and I would like not to repeat
the same
validation functions on each validate_doc_update,
I've read that validate_doc_update for each view are ran in an order
given
by couchdb, so is there any way I can load some functions before the
whole
validation process?
Do you mean validate_doc_update for each design document (each design
document can include multiple views). You can't run a function before
any
one validation function. If we had a "pre_update_validate" hook, it'd
need
guaranteed execution order and if we'd want that we could add it for
regular
validation functions as well. As fast as sharing code, you can use
CouchApp's*
library feature, where your code only lives in one place when you
develop,
but gets copied when pushed to CouchDB.
* http://github.com/couchapp/couchapp
Cheers
Jan
--