mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-23 03:43:12 +00:00
Stockage du firmware dans la bdd
This commit is contained in:
parent
d2d6f7e5e4
commit
29f00f21cd
4 changed files with 30 additions and 1 deletions
|
@ -717,7 +717,7 @@ class ProfilSerializer(NamespacedHMSerializer):
|
||||||
class ModelSwitchSerializer(NamespacedHMSerializer):
|
class ModelSwitchSerializer(NamespacedHMSerializer):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = topologie.ModelSwitch
|
model = topologie.ModelSwitch
|
||||||
fields = ('reference',)
|
fields = ('reference', 'firmware')
|
||||||
|
|
||||||
|
|
||||||
class SwitchBaySerializer(NamespacedHMSerializer):
|
class SwitchBaySerializer(NamespacedHMSerializer):
|
||||||
|
|
20
topologie/migrations/0068_modelswitch_firmware.py
Normal file
20
topologie/migrations/0068_modelswitch_firmware.py
Normal file
|
@ -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),
|
||||||
|
),
|
||||||
|
]
|
|
@ -320,6 +320,11 @@ class ModelSwitch(AclMixin, RevMixin, models.Model):
|
||||||
'topologie.ConstructorSwitch',
|
'topologie.ConstructorSwitch',
|
||||||
on_delete=models.PROTECT
|
on_delete=models.PROTECT
|
||||||
)
|
)
|
||||||
|
firmware = models.CharField(
|
||||||
|
max_length=255,
|
||||||
|
null=True,
|
||||||
|
blank=True
|
||||||
|
)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
permissions = (
|
permissions = (
|
||||||
|
|
|
@ -35,6 +35,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
<tr>
|
<tr>
|
||||||
{% trans "Reference" as tr_ref %}
|
{% trans "Reference" as tr_ref %}
|
||||||
<th>{% include "buttons/sort.html" with prefix='model-switch' col='reference' text=tr_ref %}</th>
|
<th>{% include "buttons/sort.html" with prefix='model-switch' col='reference' text=tr_ref %}</th>
|
||||||
|
<th>Firmware</th>
|
||||||
{% trans "Switch constructor" as tr_constructor %}
|
{% trans "Switch constructor" as tr_constructor %}
|
||||||
<th>{% include "buttons/sort.html" with prefix='model-switch' col='constructor' text=tr_constructor %}</th>
|
<th>{% include "buttons/sort.html" with prefix='model-switch' col='constructor' text=tr_constructor %}</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
|
@ -43,6 +44,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
{% for model_switch in model_switch_list %}
|
{% for model_switch in model_switch_list %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ model_switch.reference }}</td>
|
<td>{{ model_switch.reference }}</td>
|
||||||
|
<td>{{model_switch.firmware}}</td>
|
||||||
<td>{{ model_switch.constructor }}</td>
|
<td>{{ model_switch.constructor }}</td>
|
||||||
<td class="text-right">
|
<td class="text-right">
|
||||||
{% can_edit model_switch %}
|
{% can_edit model_switch %}
|
||||||
|
@ -64,4 +66,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
{% if model_switch_list.paginator %}
|
{% if model_switch_list.paginator %}
|
||||||
{% include "pagination.html" with list=model_switch_list %}
|
{% include "pagination.html" with list=model_switch_list %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue