title: Flask-admin, editing relationship giving me object representation of Foreign Key object
body: <p>I have a flask project, and I am getting started learning the flask-admin module. </p>
  
  <p>SqlAlchemy schema for the required tables. </p>
  
  <pre><code>import datetime
  import sqlalchemy
  from sqlalchemy.ext.declarative import declarative_base
  from sqlalchemy.orm import backref, relationship
  
  Base = declarative_base()
  
  
  class Workgroup(Base):
      __tablename__ = 'workgroups'
      id = sqlalchemy.Column(sqlalchemy.Integer,
  
                             primary_key=True,
                             autoincrement=True
                             )
      name = sqlalchemy.Column(sqlalchemy.String(16))
      shorthand = sqlalchemy.Column(sqlalchemy.String(4))
  
      def __unicode__(self):
          return self.name
  
  class Drive(Base):
      """
      A drive in an edit station.
      """
      __tablename__ = 'drives'
  
      id = sqlalchemy.Column(sqlalchemy.Integer,
                             primary_key=True,
                             autoincrement=True
                             )
      name = sqlalchemy.Column(sqlalchemy.String(64))
      computer_id = sqlalchemy.Column(sqlalchemy.Integer,
                                      sqlalchemy.ForeignKey(Computer.id)
                                      )
      computer = relationship('Computer', backref='drives')
      is_active = sqlalchemy.Column(sqlalchemy.Boolean)
      free_space = sqlalchemy.Column(sqlalchemy.BigInteger)
      used_space = sqlalchemy.Column(sqlalchemy.BigInteger)
      total_space = sqlalchemy.Column(sqlalchemy.BigInteger)
      percentage_full = sqlalchemy.Column(sqlalchemy.Float)
      boot_time = sqlalchemy.Column(sqlalchemy.DateTime)
  
      last_changed_workgroup = sqlalchemy.Column(sqlalchemy.DateTime)
      last_checked_in = sqlalchemy.Column(sqlalchemy.DateTime)
      last_notified = sqlalchemy.Column(sqlalchemy.DateTime)
      image_version = sqlalchemy.Column(sqlalchemy.String(64))
      image_date = sqlalchemy.Column(sqlalchemy.DateTime)
      current_workgroup_id = sqlalchemy.Column(sqlalchemy.Integer,
                                               sqlalchemy.ForeignKey(Workgroup.id)
                                               )
      workgroup = relationship('Workgroup', backref='drives')
  </code></pre>
  
  <h2>Admin Test</h2>
  
  <pre><code>class DriveAdmin(sqla.ModelView):
      column_display_pk = True
      column_hide_backrefs = False
      column_display_all_relations = True
      form_columns = [ 'computer_id', 'workgroup.name', ]
      column_list = ('computer.name', 'name', 'workgroup', 'computer.short_description', 'computer.notes',
                     'computer.station_type.description', 'computer.room.name')
  
  
  class WorkgroupAdmin(sqla.ModelView):
      column_display_pk = True # optional, but I like to see the IDs in the list
      column_hide_backrefs = False
      column_list = ('id', 'name', 'shorthand')
  
  
  # Create admin
  admin = admin.Admin(app, name='Example: SQLAlchemy2', template_mode='bootstrap3')
  admin.add_view(WorkgroupAdmin(schema.Workgroup, db))
  admin.add_view(DriveAdmin(schema.Drive, db))
  </code></pre>
  
  <p>replacing form columns for 'workgroup' with 'workgroup.name' gives me an invalid model property name, even though I have successfully used schema.workgroup.name elsewhere in code. </p>
  
  <p>The resulting admin form looks like this. <a href="https://i.stack.imgur.com/iQsPF.png" rel="noreferrer"><img src="https://i.stack.imgur.com/iQsPF.png" alt="enter image description here"></a></p>
  
  <p>How do I go about getting the workgroup.name value to appear as opposed to the object representation? </p>
  
  <p>Thanks for reading!</p>