diff --git a/api/serializers.py b/api/serializers.py index 52902265..8bb0833e 100644 --- a/api/serializers.py +++ b/api/serializers.py @@ -717,7 +717,7 @@ class ProfilSerializer(NamespacedHMSerializer): class ModelSwitchSerializer(NamespacedHMSerializer): class Meta: model = topologie.ModelSwitch - fields = ('reference',) + fields = ('reference', 'firmware') class SwitchBaySerializer(NamespacedHMSerializer): diff --git a/topologie/migrations/0068_modelswitch_firmware.py b/topologie/migrations/0068_modelswitch_firmware.py new file mode 100644 index 00000000..8596f58f --- /dev/null +++ b/topologie/migrations/0068_modelswitch_firmware.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.7 on 2018-07-08 19:56 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('topologie', '0067_auto_20180701_0016'), + ] + + operations = [ + migrations.AddField( + model_name='modelswitch', + name='firmware', + field=models.CharField(blank=True, max_length=255, null=True), + ), + ] diff --git a/topologie/models.py b/topologie/models.py index 7ca285be..1c275026 100644 --- a/topologie/models.py +++ b/topologie/models.py @@ -320,6 +320,11 @@ class ModelSwitch(AclMixin, RevMixin, models.Model): 'topologie.ConstructorSwitch', on_delete=models.PROTECT ) + firmware = models.CharField( + max_length=255, + null=True, + blank=True + ) class Meta: permissions = ( diff --git a/topologie/templates/topologie/aff_model_switch.html b/topologie/templates/topologie/aff_model_switch.html index 6b3e7156..7fd1b37c 100644 --- a/topologie/templates/topologie/aff_model_switch.html +++ b/topologie/templates/topologie/aff_model_switch.html @@ -35,6 +35,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,