title: marking columns in sqlalchemy tables
body: <p>I'd like to add a custom attribute "searchable" to the columns in an sqlalchemy model. The purpose is to extract data for just these columns (using ModelFoo.__ table__.columns) and put the data into solr. Is there a way I can mark certain columns using a custom attribute?</p>
  
  <pre><code>class ModelFoo(AppBase):
      __tablename__ = 'foo'
      id = Column("id", Integer, primary_key=True, autoincrement=True)
      os = Column(String, nullable=False, searchable=True)
      platform = Column(String, searchable=True)
  </code></pre>
  
  <p>by default, I get the following error when I try the above:</p>
  
  <pre><code>sqlalchemy.exc.ArgumentError: Unknown arguments passed to Column: ['searchable']
  </code></pre>
  
  <p>I am looking for a generic way to add only "searchable" columns to solr,  something along these lines:</p>
  
  <pre><code>for table in Base.metadata.tables.values():
      keys = [str(key) for key in table.columns if key.searchable] 
      solr.add(session.query(*keys).all())
  </code></pre>
  
  <p>in the above code, I am looking for some short solution or alternative to get "key.searchable" to work. Hope this clarifies the question.</p>