'Return a list of models for a connection.'

def _get_models_for_connection(self, connection):

    tables = connection.introspection.get_table_list(connection.cursor())
    return [m for m in apps.get_models() if (m._meta.db_table in tables)]
