# Generated by Django A.B on YYYY-MM-DD HH:MM
from django.db import migrations

from OSM_outils.OSMnx_recuperation_graph_information import OSMnx_recuperation_graph_information

def ajoute_donnees_nouvelle_colonne(apps, schema_editor):
    """
    Cette méthode permet de faire une migration de donnée pour la nouvelle colonne ajoutée

    """
    graph_viaire_ville_information = apps.get_model('recuperateur_reseau_viaire', 'Graph_viaire_ville_information')
    for graph in graph_viaire_ville_information.objects.all():
        G = OSMnx_recuperation_graph_information.lire_graphe(graph.gvvi_nom)
        graph. = OSMnx_recuperation_graph_information.fct(G)[''] 
        graph.save()
class Migration(migrations.Migration):

    dependencies = [
        ('yourappname', '0001_initial'),
    ]

    operations = [
        migrations.RunPython(ajoute_donnees_nouvelle_colonne)
    ]
