title: Stripping whitespace generically for all String fields - SQLAlchemy
body: <p>I am using SQLAlchemy through Flask-SQLAlchemy as the ORM for a web app. </p>
  
  <p>I'd like to automatically leading and trailing strip whitespace (e.g. <code>str.strip</code>) when assigning to any string field.</p>
  
  <p>One way to do this would be the following, but it would need to be specified for each and every string field:</p>
  
  <pre><code>class User(db.Model):
      _email = db.Column('email', db.String(100), primary_key=True)
      @hybrid_property
      def email(self): return self._email
      @email.setter
      def email(self, data): self._email = data.strip()
  </code></pre>
  
  <p>I would like to do this more generically for every String field (without having to write the above for each). </p>