title: data validation for SQLAlchemy declarative models
body: <p>I'm using CherryPy, Mako templates, and SQLAlchemy in a web app.  I'm coming from a Ruby on Rails background and I'm trying to set up some data validation for my models.  I can't figure out the best way to ensure, say, a 'name' field has a value when some other field has a value.  I tried using <a href="http://pypi.python.org/pypi/SAValidation">SAValidation</a> but it allowed me to create new rows where a required column was blank, even when I used <code>validates_presence_of</code> on the column.  I've been looking at <a href="http://wtforms.simplecodes.com/">WTForms</a> but that seems to involve a lot of duplicated code--I already have my model class set up with the columns in the table, why do I need to repeat all those columns again just to say "hey this one needs a value"?  I'm coming from the "<a href="http://weblog.jamisbuck.org/2006/10/18/skinny-controller-fat-model">skinny controller, fat model</a>" mindset and have been looking for Rails-like methods in my model like <code>validates_presence_of</code> or <code>validates_length_of</code>.  How should I go about validating the data my model receives, and ensuring <code>Session.add</code>/<code>Session.merge</code> fail when the validations fail?</p>