Browse Source

Matériels : modification du model + migration

cecile 6 years ago
parent
commit
2e4f7e26cc

+ 25 - 0
coin/members/migrations/0018_auto_20180818_1855.py

@@ -0,0 +1,25 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+import coin.members.models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('members', '0017_merge'),
+    ]
+
+    operations = [
+        migrations.AlterModelOptions(
+            name='rowlevelpermission',
+            options={'verbose_name': 'permission fine', 'verbose_name_plural': 'permissions fines'},
+        ),
+        migrations.AlterModelManagers(
+            name='member',
+            managers=[
+                ('objects', coin.members.models.MemberManager()),
+            ],
+        ),
+    ]

+ 23 - 0
hardware_provisioning/migrations/0018_auto_20180818_1855.py

@@ -0,0 +1,23 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('hardware_provisioning', '0017_item_deployed'),
+    ]
+
+    operations = [
+        migrations.AlterModelOptions(
+            name='item',
+            options={'ordering': ['designation', 'mac_address', 'serial'], 'verbose_name': 'objet'},
+        ),
+        migrations.AddField(
+            model_name='item',
+            name='offer_subscription',
+            field=models.ForeignKey(related_name='offersubscription', verbose_name='Abonnement', blank=True, to='hardware_provisioning.ItemType', null=True),
+        ),
+    ]

+ 19 - 0
hardware_provisioning/migrations/0019_auto_20180818_1930.py

@@ -0,0 +1,19 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('hardware_provisioning', '0018_auto_20180818_1855'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='item',
+            name='offer_subscription',
+            field=models.ForeignKey(related_name='items', verbose_name='Abonnement', blank=True, to='offers.OfferSubscription', null=True),
+        ),
+    ]

+ 3 - 0
hardware_provisioning/models.py

@@ -5,6 +5,7 @@ from django.db import models
 from django.db.models import Q
 from django.conf import settings
 from django.utils import timezone
+from coin.offers.models import OfferSubscription
 
 from .fields import MACAddressField
 
@@ -70,6 +71,8 @@ class Item(models.Model):
                                    help_text='Cocher si le matériel est en production')
     comment = models.TextField(verbose_name='commentaire', blank=True,
                                null=True)
+    offer_subscription = models.ForeignKey(OfferSubscription, verbose_name='Abonnement',
+                             related_name='items', blank=True, null=True)
 
     objects = ItemQuerySet().as_manager()