title: SQLAlchemy best way to define __repr__ for large tables
body: <p>I have a bunch of tables in SQLAlchemy that I want to define <code>__repr__</code>.</p>
  
  <p>The standard convention seems to look like this:</p>
  
  <pre><code>def __repr__(self):
      return "&lt;TableName(id='%s')&gt;" % self.id
  </code></pre>
  
  <p>This is all well and good for small tables.  However, I have tables with 40+ columns.  <strong>Is there a better way of constructing <code>__repr__</code> such that I am not manually typing out a massive string?</strong></p>
  
  <p>My file housing all tables is called <code>models.py</code>.  One solution I thought about was making a method <code>_create_repr_string</code> in <code>models.py</code> that takes care of auto-generating the string for <code>__repr__</code> to return.  I am wondering if there is a more standard way to create <code>__repr__</code>.</p>