title: How to get sqlalchemy length of a string column
body: <p>Consider this simple table definition (using SQLAlchemy-0.5.6)</p>
  
  <pre class="lang-py prettyprint-override"><code>from sqlalchemy import *
  
  db = create_engine('sqlite:///tutorial.db')
  
  db.echo = False  # Try changing this to True and see what happens
  
  metadata = MetaData(db)
  
  user = Table('user', metadata,
      Column('user_id', Integer, primary_key=True),
      Column('name', String(40)),
      Column('age', Integer),
      Column('password', String),
  )
  
  from sqlalchemy.ext.declarative import declarative_base
  
  class User(declarative_base()):
  
      __tablename__ = 'user'
      user_id = Column('user_id', Integer, primary_key=True)
      name = Column('name', String(40))
  </code></pre>
  
  <p>I want to know what is the max length of column name e.g. from user table and from User (declarative class)</p>
  
  <pre class="lang-py prettyprint-override"><code>print user.name.length
  print User.name.length
  </code></pre>
  
  <p>I have tried (User.name.type.length) but it throws exception</p>
  
  <pre class="lang-py prettyprint-override"><code>Traceback (most recent call last):
    File "del.py", line 25, in &lt;module&gt;
      print User.name.type.length
    File "/usr/lib/python2.5/site-packages/SQLAlchemy-0.5.6-py2.5.egg/sqlalchemy/orm/attributes.py", line 135, in __getattr__
      key)
  AttributeError: Neither 'InstrumentedAttribute' object nor 'Comparator' object has an attribute 'type'
  </code></pre>