(load_stats)
Reset DB sequences if needed
Reset DB sequences if needed
Reset DB sequences if needed
def _reset_sequences(load_stats):
    """Reset DB sequences if needed"""
    for stat in load_stats:
        loaded_object_count = sum(stat.model_counter.values())
        if loaded_object_count > 0:
            connection = connections[stat.db_alias]
            models = list(stat.model_counter)
            sequence_sql = connection.ops.sequence_reset_sql(no_style(), models)
            if sequence_sql:
                with connection.cursor() as cursor:
                    for line in sequence_sql:
                        cursor.execute(line)
def _reset_sequences ( load_stats ) : for stat in load_stats : loaded_object_count = sum ( stat . model_counter . values ( ) ) if loaded_object_count > 0 : connection = connections [ stat . db_alias ] models = list ( stat . model_counter ) sequence_sql = connection . ops . sequence_reset_sql ( no_style ( ) , models ) if sequence_sql : with connection . cursor ( ) as cursor : for line in sequence_sql : cursor . execute ( line )