From 3a2e0073726739d505a8eed0cef4124adec9900a Mon Sep 17 00:00:00 2001 From: Gabriel Detraz Date: Sun, 25 Mar 2018 04:05:26 +0200 Subject: [PATCH] =?UTF-8?q?Switch=20h=C3=A9rite=20de=20interface?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- topologie/forms.py | 34 +++--- .../migrations/0037_auto_20180325_0127.py | 33 +++++ topologie/migrations/0038_transfersw.py | 37 ++++++ topologie/migrations/0039_port_new_switch.py | 21 ++++ topologie/migrations/0040_transferports.py | 28 +++++ topologie/migrations/0041_transferportsw.py | 20 +++ topologie/migrations/0042_transferswitch.py | 18 +++ topologie/migrations/0043_renamenewswitch.py | 16 +++ topologie/models.py | 16 +-- topologie/templates/topologie/aff_switch.html | 6 +- topologie/templates/topologie/switch.html | 29 +---- .../topologie/{borne.html => topo_more.html} | 6 +- topologie/views.py | 115 ++++++++---------- 13 files changed, 253 insertions(+), 126 deletions(-) create mode 100644 topologie/migrations/0037_auto_20180325_0127.py create mode 100644 topologie/migrations/0038_transfersw.py create mode 100644 topologie/migrations/0039_port_new_switch.py create mode 100644 topologie/migrations/0040_transferports.py create mode 100644 topologie/migrations/0041_transferportsw.py create mode 100644 topologie/migrations/0042_transferswitch.py create mode 100644 topologie/migrations/0043_renamenewswitch.py rename topologie/templates/topologie/{borne.html => topo_more.html} (90%) diff --git a/topologie/forms.py b/topologie/forms.py index 42572fe7..cc9b59d8 100644 --- a/topologie/forms.py +++ b/topologie/forms.py @@ -78,7 +78,7 @@ class EditPortForm(ModelForm): self.fields['machine_interface'].queryset = Interface.objects.all()\ .select_related('domain__extension') self.fields['related'].queryset = Port.objects.all()\ - .select_related('switch__switch_interface__domain__extension')\ + .select_related('switch__domain__extension')\ .order_by('switch', 'port') @@ -95,7 +95,7 @@ class AddPortForm(ModelForm): self.fields['machine_interface'].queryset = Interface.objects.all()\ .select_related('domain__extension') self.fields['related'].queryset = Port.objects.all()\ - .select_related('switch__switch_interface__domain__extension')\ + .select_related('switch__domain__extension')\ .order_by('switch', 'port') @@ -126,32 +126,30 @@ class EditBorneForm(EditInterfaceForm): fields = ['machine', 'type', 'ipv4', 'mac_address', 'details', 'location'] -class EditSwitchForm(ModelForm): +class EditSwitchForm(EditInterfaceForm): """Permet d'éditer un switch : nom et nombre de ports""" class Meta: model = Switch - fields = '__all__' + fields = ['machine', 'type', 'ipv4', 'mac_address', 'details', 'location', 'number', 'stack', 'stack_member_id'] - def __init__(self, *args, **kwargs): - prefix = kwargs.pop('prefix', self.Meta.model.__name__) - super(EditSwitchForm, self).__init__(*args, prefix=prefix, **kwargs) - self.fields['switch_interface'].queryset = Interface.objects.all()\ - .select_related('domain__extension') - self.fields['location'].label = 'Localisation' - self.fields['number'].label = 'Nombre de ports' + # def __init__(self, *args, **kwargs): + # prefix = kwargs.pop('prefix', self.Meta.model.__name__) + # super(EditInterfaceForm, self).__init__(*args, prefix=prefix, **kwargs) + # self.fields['location'].label = 'Localisation' + # self.fields['number'].label = 'Nombre de ports' -class NewSwitchForm(ModelForm): +class NewSwitchForm(EditInterfaceForm): """Permet de créer un switch : emplacement, paramètres machine, membre d'un stack (option), nombre de ports (number)""" class Meta(EditSwitchForm.Meta): - fields = ['location', 'number', 'details', 'stack', 'stack_member_id'] + fields = ['type', 'ipv4', 'mac_address', 'details', 'location', 'number', 'stack', 'stack_member_id'] - def __init__(self, *args, **kwargs): - prefix = kwargs.pop('prefix', self.Meta.model.__name__) - super(NewSwitchForm, self).__init__(*args, prefix=prefix, **kwargs) - self.fields['location'].label = 'Localisation' - self.fields['number'].label = 'Nombre de ports' + #def __init__(self, *args, **kwargs): + # prefix = kwargs.pop('prefix', self.Meta.model.__name__) + # super(NewSwitchForm, self).__init__(*args, prefix=prefix, **kwargs) + # self.fields['location'].label = 'Localisation' + # self.fields['number'].label = 'Nombre de ports' class EditRoomForm(ModelForm): """Permet d'éediter le nom et commentaire d'une prise murale""" diff --git a/topologie/migrations/0037_auto_20180325_0127.py b/topologie/migrations/0037_auto_20180325_0127.py new file mode 100644 index 00000000..30b34e58 --- /dev/null +++ b/topologie/migrations/0037_auto_20180325_0127.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.7 on 2018-03-25 00:27 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('machines', '0076_auto_20180130_1623'), + ('topologie', '0036_transferborne'), + ] + + operations = [ + migrations.CreateModel( + name='NewSwitch', + fields=[ + ('interface_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='machines.Interface')), + ('location', models.CharField(max_length=255)), + ('number', models.PositiveIntegerField()), + ('stack_member_id', models.PositiveIntegerField(blank=True, null=True)), + ('model', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='topologie.ModelSwitch')), + ('stack', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='topologie.Stack')), + ], + bases=('machines.interface',), + ), + migrations.AlterUniqueTogether( + name='newswitch', + unique_together=set([('stack', 'stack_member_id')]), + ), + ] diff --git a/topologie/migrations/0038_transfersw.py b/topologie/migrations/0038_transfersw.py new file mode 100644 index 00000000..6f79825f --- /dev/null +++ b/topologie/migrations/0038_transfersw.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.7 on 2017-12-31 19:53 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('topologie', '0037_auto_20180325_0127'), + ] + + def transfer_sw(apps, schema_editor): + db_alias = schema_editor.connection.alias + newswitch = apps.get_model("topologie", "NewSwitch") + switch = apps.get_model("topologie", "Switch") + interface = apps.get_model("machines", "Interface") + sw_list = switch.objects.using(db_alias).all() + for sw in sw_list: + new_sw = newswitch() + new_sw.location = sw.location + new_sw.number = sw.number + new_sw.details = sw.details + new_sw.stack = sw.stack + new_sw.stack_member_id = sw.stack_member_id + new_sw.model = sw.model + new_sw.interface_ptr_id = sw.switch_interface.pk + new_sw.__dict__.update(sw.switch_interface.__dict__) + new_sw.save() + + def untransfer_sw(apps, schema_editor): + return + + operations = [ + migrations.RunPython(transfer_sw, untransfer_sw), + ] diff --git a/topologie/migrations/0039_port_new_switch.py b/topologie/migrations/0039_port_new_switch.py new file mode 100644 index 00000000..33dda2b4 --- /dev/null +++ b/topologie/migrations/0039_port_new_switch.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.7 on 2018-03-25 00:52 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('topologie', '0038_transfersw'), + ] + + operations = [ + migrations.AddField( + model_name='port', + name='new_switch', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ports', to='topologie.NewSwitch'), + ), + ] diff --git a/topologie/migrations/0040_transferports.py b/topologie/migrations/0040_transferports.py new file mode 100644 index 00000000..7f72edc2 --- /dev/null +++ b/topologie/migrations/0040_transferports.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.7 on 2017-12-31 19:53 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('topologie', '0039_port_new_switch'), + ] + + def transfer_port(apps, schema_editor): + db_alias = schema_editor.connection.alias + port = apps.get_model("topologie", "Port") + switch = apps.get_model("topologie", "NewSwitch") + port_list = port.objects.using(db_alias).all() + for p in port_list: + p.new_switch = switch.objects.filter(interface_ptr=p.switch.switch_interface).first() + p.save() + + def untransfer_port(apps, schema_editor): + return + + operations = [ + migrations.RunPython(transfer_port, untransfer_port), + ] diff --git a/topologie/migrations/0041_transferportsw.py b/topologie/migrations/0041_transferportsw.py new file mode 100644 index 00000000..a629c7e6 --- /dev/null +++ b/topologie/migrations/0041_transferportsw.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.7 on 2017-12-31 19:53 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('topologie', '0040_transferports'), + ] + + operations = [ + migrations.RemoveField( + model_name='port', + name='switch', + ), + migrations.RenameField('Port', 'new_switch', 'switch') + ] diff --git a/topologie/migrations/0042_transferswitch.py b/topologie/migrations/0042_transferswitch.py new file mode 100644 index 00000000..96ad49dc --- /dev/null +++ b/topologie/migrations/0042_transferswitch.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.7 on 2017-12-31 19:53 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('topologie', '0041_transferportsw'), + ] + + operations = [ + migrations.DeleteModel( + name='Switch', + ), + ] diff --git a/topologie/migrations/0043_renamenewswitch.py b/topologie/migrations/0043_renamenewswitch.py new file mode 100644 index 00000000..3deeced4 --- /dev/null +++ b/topologie/migrations/0043_renamenewswitch.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.7 on 2017-12-31 19:53 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('topologie', '0042_transferswitch'), + ] + + operations = [ + migrations.RenameModel(old_name='NewSwitch', new_name='Switch'), + ] diff --git a/topologie/models.py b/topologie/models.py index 5c48773f..ca5c7093 100644 --- a/topologie/models.py +++ b/topologie/models.py @@ -156,7 +156,7 @@ class Borne(Interface): return True, None -class Switch(models.Model): +class Switch(Interface): """ Definition d'un switch. Contient un nombre de ports (number), un emplacement (location), un stack parent (optionnel, stack) et un id de membre dans le stack (stack_member_id) @@ -170,13 +170,9 @@ class Switch(models.Model): id_max de la stack parente""" PRETTY_NAME = "Switch / Commutateur" - switch_interface = models.OneToOneField( - 'machines.Interface', - on_delete=models.CASCADE - ) + location = models.CharField(max_length=255) number = models.PositiveIntegerField() - details = models.CharField(max_length=255, blank=True) stack = models.ForeignKey( 'topologie.Stack', blank=True, @@ -194,7 +190,7 @@ class Switch(models.Model): class Meta: unique_together = ('stack', 'stack_member_id') permissions = ( - ("view_switch", "Peut voir un objet switch"), + ("view_newswitch", "Peut voir un objet switch"), ) def get_instance(switch_id, *args, **kwargs): @@ -224,8 +220,8 @@ class Switch(models.Model): return False, u"Vous n'avez pas le droit de voir les switch" return True, None - def __str__(self): - return self.location + ' ' + str(self.switch_interface) +# def __str__(self): +# return self.location + ' ' + str(self.switch_interface) def clean(self): """ Verifie que l'id stack est dans le bon range""" @@ -421,7 +417,7 @@ class Port(models.Model): def get_instance(port_id, *args, **kwargs): return Port.objects\ - .select_related('switch__switch_interface__domain__extension')\ + .select_related('switch__domain__extension')\ .select_related('machine_interface__domain__extension')\ .select_related('machine_interface__switch')\ .select_related('room')\ diff --git a/topologie/templates/topologie/aff_switch.html b/topologie/templates/topologie/aff_switch.html index 38980736..c8c9e6e0 100644 --- a/topologie/templates/topologie/aff_switch.html +++ b/topologie/templates/topologie/aff_switch.html @@ -46,10 +46,10 @@ with this program; if not, write to the Free Software Foundation, Inc., - {{switch.switch_interface}} + {{switch}} - {{switch.switch_interface.ipv4}} + {{switch.ipv4}} {{switch.location}} {{switch.number}} {{switch.stack.name}} @@ -62,7 +62,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {% include 'buttons/edit.html' with href='topologie:edit-switch' id=switch.pk %} {% acl_end %} {% can_delete switch %} - {% include 'buttons/suppr.html' with href='machines:del-interface' id=switch.switch_interface.id %} + {% include 'buttons/suppr.html' with href='machines:del-interface' id=switch.id %} {% acl_end %} {% can_create Port %} {% include 'buttons/add.html' with href='topologie:create-ports' id=switch.pk desc='Création de ports'%} diff --git a/topologie/templates/topologie/switch.html b/topologie/templates/topologie/switch.html index 54842d55..4b334896 100644 --- a/topologie/templates/topologie/switch.html +++ b/topologie/templates/topologie/switch.html @@ -32,44 +32,17 @@ with this program; if not, write to the Free Software Foundation, Inc., {% if topoform %} {% bootstrap_form_errors topoform %} {% endif %} -{% if machineform %} -{% bootstrap_form_errors machineform %} -{% endif %} -{% if interfaceform %} -{% bootstrap_form_errors interfaceform %} -{% endif %} -{% if domainform %} -{% bootstrap_form_errors domainform %} -{% endif %} -{% if id_switch %} {% bootstrap_icon "list" %} Aller à la liste des ports -{% endif %}
{% csrf_token %} {% if topoform %}

Réglage spécifiques du switch

{% massive_bootstrap_form topoform 'switch_interface' %} {% endif %} - {% if machineform %} -

Réglages généraux de la machine associée au switch

- {% massive_bootstrap_form machineform 'user' %} - {% endif %} - {% if interfaceform %} -

Réglages généraux de l'interface associée au switch

- {% if i_mbf_param %} - {% massive_bootstrap_form interfaceform 'ipv4,machine' mbf_param=i_mbf_param %} - {% else %} - {% massive_bootstrap_form interfaceform 'ipv4,machine' %} - {% endif %} - {% endif %} - {% if domainform %} -

Nom de la machine

- {% bootstrap_form domainform %} - {% endif %} - {% bootstrap_button "Créer ou modifier" button_type="submit" icon="ok" %} + {% bootstrap_button "Créer" button_type="submit" icon="ok" %}


diff --git a/topologie/templates/topologie/borne.html b/topologie/templates/topologie/topo_more.html similarity index 90% rename from topologie/templates/topologie/borne.html rename to topologie/templates/topologie/topo_more.html index 57e015d5..d1147ff8 100644 --- a/topologie/templates/topologie/borne.html +++ b/topologie/templates/topologie/topo_more.html @@ -26,7 +26,7 @@ with this program; if not, write to the Free Software Foundation, Inc., {% load bootstrap3 %} {% load massive_bootstrap_form %} -{% block title %}Création et modification d'une borne{% endblock %} +{% block title %}Création et modification d'un objet topologie{% endblock %} {% block content %} {% if topoform %} @@ -44,11 +44,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% csrf_token %} {% if topoform %} -

Réglage spécifiques de la borne

+

Réglage spécifiques du {{ device }}

{% massive_bootstrap_form topoform 'ipv4,machine' mbf_param=i_mbf_param%} {% endif %} {% if machineform %} -

Réglages généraux de la machine associée à la borne

+

Réglages généraux de la machine associée au {{ device }}

{% massive_bootstrap_form machineform 'user' %} {% endif %} {% if domainform %} diff --git a/topologie/views.py b/topologie/views.py index 4c50acf5..97091a83 100644 --- a/topologie/views.py +++ b/topologie/views.py @@ -92,9 +92,9 @@ from preferences.models import AssoOption, GeneralOption def index(request): """ Vue d'affichage de tous les swicthes""" switch_list = Switch.objects\ - .select_related('switch_interface__domain__extension')\ - .select_related('switch_interface__ipv4')\ - .select_related('switch_interface__domain')\ + .select_related('domain__extension')\ + .select_related('ipv4')\ + .select_related('domain')\ .select_related('stack') switch_list = SortTable.sort( switch_list, @@ -128,7 +128,7 @@ def index_port(request, switch, switch_id): .select_related('machine_interface__domain__extension')\ .select_related('machine_interface__machine__user')\ .select_related( - 'related__switch__switch_interface__domain__extension' + 'related__switch__domain__extension' )\ .select_related('switch') port_list = SortTable.sort( @@ -203,7 +203,7 @@ def index_borne(request): def index_stack(request): """Affichage de la liste des stacks (affiche l'ensemble des switches)""" stack_list = Stack.objects\ - .prefetch_related('switch_set__switch_interface__domain__extension') + .prefetch_related('switch_set__domain__extension') stack_list = SortTable.sort( stack_list, request.GET.get('col'), @@ -381,19 +381,18 @@ def new_switch(request): """ Creation d'un switch. Cree en meme temps l'interface et la machine associée. Vue complexe. Appelle successivement les 4 models forms adaptés : machine, interface, domain et switch""" - switch = NewSwitchForm(request.POST or None) + switch = NewSwitchForm( + request.POST or None, + user=request.user + ) machine = NewMachineForm( request.POST or None, user=request.user ) - interface = AddInterfaceForm( - request.POST or None, - user=request.user - ) domain = DomainForm( request.POST or None, ) - if switch.is_valid() and machine.is_valid() and interface.is_valid(): + if switch.is_valid() and machine.is_valid(): user = AssoOption.get_cached_value('utilisateur_asso') if not user: messages.error(request, "L'user association n'existe pas encore,\ @@ -401,38 +400,34 @@ def new_switch(request): return redirect(reverse('topologie:index')) new_machine = machine.save(commit=False) new_machine.user = user - new_interface = interface.save(commit=False) new_switch_instance = switch.save(commit=False) - new_domain_instance = domain.save(commit=False) - with transaction.atomic(), reversion.create_revision(): - new_machine.save() - reversion.set_user(request.user) - reversion.set_comment("Création") - new_interface.machine = new_machine - with transaction.atomic(), reversion.create_revision(): - new_interface.save() - reversion.set_user(request.user) - reversion.set_comment("Création") - new_domain_instance.interface_parent = new_interface - with transaction.atomic(), reversion.create_revision(): - new_domain_instance.save() - reversion.set_user(request.user) - reversion.set_comment("Création") - new_switch_instance.switch_interface = new_interface - with transaction.atomic(), reversion.create_revision(): - new_switch_instance.save() - reversion.set_user(request.user) - reversion.set_comment("Création") - messages.success(request, "Le switch a été créé") - return redirect(reverse('topologie:index')) - i_mbf_param = generate_ipv4_mbf_param( interface, False) + domain.instance.interface_parent = new_switch_instance + if domain.is_valid(): + new_domain_instance = domain.save(commit=False) + with transaction.atomic(), reversion.create_revision(): + new_machine.save() + reversion.set_user(request.user) + reversion.set_comment("Création") + new_switch_instance.machine = new_machine + with transaction.atomic(), reversion.create_revision(): + new_switch_instance.save() + reversion.set_user(request.user) + reversion.set_comment("Création") + new_domain_instance.interface_parent = new_switch_instance + with transaction.atomic(), reversion.create_revision(): + new_domain_instance.save() + reversion.set_user(request.user) + reversion.set_comment("Création") + messages.success(request, "Le switch a été créé") + return redirect(reverse('topologie:index')) + i_mbf_param = generate_ipv4_mbf_param(switch, False) return form({ 'topoform': switch, 'machineform': machine, - 'interfaceform': interface, 'domainform': domain, - 'i_mbf_param': i_mbf_param - }, 'topologie/switch.html', request) + 'i_mbf_param': i_mbf_param, + 'device' : 'switch', + }, 'topologie/topo_more.html', request) @login_required @@ -470,7 +465,6 @@ def create_ports(request, switch_id): 'topologie:index-port', kwargs={'switch_id':switch_id} )) - return form({'id_switch': switch_id, 'topoform': port_form}, 'topologie/switch.html', request) @@ -480,24 +474,21 @@ def edit_switch(request, switch, switch_id): """ Edition d'un switch. Permet de chambre nombre de ports, place dans le stack, interface et machine associée""" - switch_form = EditSwitchForm(request.POST or None, instance=switch) - machine_form = EditMachineForm( + switch_form = EditSwitchForm( request.POST or None, - instance=switch.switch_interface.machine, + instance=switch, user=request.user ) - interface_form = EditInterfaceForm( + machine_form = EditMachineForm( request.POST or None, - instance=switch.switch_interface, + instance=switch.machine, user=request.user ) domain_form = DomainForm( request.POST or None, - instance=switch.switch_interface.domain + instance=switch.domain ) - if switch_form.is_valid() and machine_form.is_valid()\ - and interface_form.is_valid(): - new_interface = interface_form.save(commit=False) + if switch_form.is_valid() and machine_form.is_valid(): new_machine = machine_form.save(commit=False) new_switch_instance = switch_form.save(commit=False) new_domain = domain_form.save(commit=False) @@ -510,10 +501,10 @@ def edit_switch(request, switch, switch_id): ) ) with transaction.atomic(), reversion.create_revision(): - new_interface.save() + new_switch_instance.save() reversion.set_user(request.user) reversion.set_comment("Champs modifié(s) : %s" % ', '.join( - field for field in interface_form.changed_data) + field for field in switch_form.changed_data) ) with transaction.atomic(), reversion.create_revision(): new_domain.save() @@ -521,23 +512,17 @@ def edit_switch(request, switch, switch_id): reversion.set_comment("Champs modifié(s) : %s" % ', '.join( field for field in domain_form.changed_data) ) - with transaction.atomic(), reversion.create_revision(): - new_switch_instance.save() - reversion.set_user(request.user) - reversion.set_comment("Champs modifié(s) : %s" % ', '.join( - field for field in switch_form.changed_data) - ) messages.success(request, "Le switch a bien été modifié") return redirect(reverse('topologie:index')) - i_mbf_param = generate_ipv4_mbf_param( interface_form, False ) + i_mbf_param = generate_ipv4_mbf_param(switch_form, False ) return form({ 'id_switch': switch_id, 'topoform': switch_form, 'machineform': machine_form, - 'interfaceform': interface_form, 'domainform': domain_form, - 'i_mbf_param': i_mbf_param - }, 'topologie/switch.html', request) + 'i_mbf_param': i_mbf_param, + 'device' : 'switch', + }, 'topologie/topo_more.html', request) @login_required @@ -590,8 +575,9 @@ def new_borne(request): 'topoform': borne, 'machineform': machine, 'domainform': domain, - 'i_mbf_param': i_mbf_param - }, 'topologie/borne.html', request) + 'i_mbf_param': i_mbf_param, + 'device' : 'wifi ap', + }, 'topologie/topo_more.html', request) @login_required @@ -649,8 +635,9 @@ def edit_borne(request, borne, borne_id): 'topoform': borne_form, 'machineform': machine_form, 'domainform': domain_form, - 'i_mbf_param': i_mbf_param - }, 'topologie/borne.html', request) + 'i_mbf_param': i_mbf_param, + 'device' : 'wifi ap', + }, 'topologie/topo_more.html', request) @login_required