diff --git a/equipment/admin.py b/equipment/admin.py index 03bf7e3..fb91450 100644 --- a/equipment/admin.py +++ b/equipment/admin.py @@ -34,15 +34,11 @@ class IdFormset(forms.models.BaseInlineFormSet): class EquipmentRevisionExtraInline(admin.TabularInline): model = EquipmentRevision extra = 0 - form = IdForm - formset = IdFormset class EquipmentRemarkExtraInline(admin.TabularInline): model = EquipmentRemark extra = 0 - form = IdForm - formset = IdFormset class EquipmentAdmin(admin.ModelAdmin): diff --git a/equipment/migrations/0002_auto_20180806_1403.py b/equipment/migrations/0002_auto_20180806_1403.py new file mode 100644 index 0000000..6932d28 --- /dev/null +++ b/equipment/migrations/0002_auto_20180806_1403.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.11 on 2018-08-06 14:03 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('equipment', '0001_initial'), + ] + + operations = [ + migrations.RemoveField( + model_name='equipmentremark', + name='ids', + ), + migrations.RemoveField( + model_name='equipmentrevision', + name='ids', + ), + migrations.AddField( + model_name='equipmentremark', + name='ide', + field=models.PositiveSmallIntegerField(default=0, verbose_name='id'), + preserve_default=False, + ), + migrations.AddField( + model_name='equipmentrevision', + name='ide', + field=models.PositiveSmallIntegerField(default=0, verbose_name='id'), + preserve_default=False, + ), + ] diff --git a/equipment/models.py b/equipment/models.py index 384f188..410154b 100644 --- a/equipment/models.py +++ b/equipment/models.py @@ -61,7 +61,7 @@ class EquipmentRemark(models.Model): related_name="remarks", help_text=_("Matériel concerné par la remarque"), ) - ids = IdField() + ide = models.PositiveSmallIntegerField(_("id")) is_broken = models.BooleanField() is_lost = models.BooleanField() @@ -85,7 +85,7 @@ class EquipmentRevision(models.Model): help_text=_("Matériel concerné par les révisions"), ) remark = models.TextField(_("remarque sur la révision")) - ids = IdField() + ide = models.PositiveSmallIntegerField(_("id")) class Meta: verbose_name = _("révision de matériel")