[sqlalchemy] adding validates() decorator after class creation

2013-01-04 Thread lars van gemerden
Hi, I am trying to use validates() to dynamically add validation to my sqla classes, but i cannot figure out how to do this. I have read python decorator docs and docs n validates, but something escapes me (or it is just not possible). A code snippet (this does not work): def

Re: [sqlalchemy] adding validates() decorator after class creation

2013-01-04 Thread Michael Bayer
@validates is a decorator that's typically associated with a class before it's mapped. It is essentially a mapper-time directive which is converted into an attribute event. If you're trying to associate these events with class attributes en-masse, and particularly that may already be mapped,