code: def register_classes_for_admin(db_session, show_pks=True, name='admin'):
      
  
      with app.app_context():
          admin_view = Admin(current_app, name=name)
          for cls in set(
              cls for cls in current_app.class_references.values() if
                  cls.use_admin):
              column_list = [column.name for column in
                             cls.__table__.columns.values()]
              if hasattr(cls, '__view__'):
                  # allow ability for model classes to specify model views
                  admin_view_class = type(
                      'AdminView',
                      (cls.__view__,),
                      {'form_columns': column_list})
              elif show_pks:
                  # the default of Flask-SQLAlchemy is to not show primary
                  # classes, which obviously isn't acceptable in some cases
                  admin_view_class = type(
                      'AdminView',
                      (AdminModelViewWithPK,),
                      {'form_columns': column_list})
              else:
                  admin_view_class = ModelView
              admin_view.add_view(admin_view_class(cls, db_session))
docs: Registers classes for the Admin view that ultimately creates the admin
      interface.
  
      :param db_session: handle to database session
      :param list classes: list of classes to register with the admin
      :param bool show_pks: show primary key columns in the admin?