title: SQLAlchemy: avoiding repetition in declarative style class definition
body: <p>I'm using SQLAlchemy, and many classes in my object model have the same two attributes: id and (integer &amp; primary key), and name (a string). I'm trying to avoid declaring them in every class like so:</p>
  
  <pre><code>class C1(declarative_base()):
      id = Column(Integer, primary_key = True)
      name = Column(String)
      #...
  
  class C2(declarative_base()):
      id = Column(Integer, primary_key = True)
      name = Column(String)
      #...
  </code></pre>
  
  <p>What's a good way to do that? I tried using metaclasses but it didn't work yet.</p>