Browse Source

Move "comment" field to the generic configuration model (fixes #234)

Note that this will reset the content of all comment fields.
Baptiste Jonglez 10 years ago
parent
commit
362303ff26

+ 20 - 0
coin/configuration/migrations/0003_configuration_comment.py

@@ -0,0 +1,20 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import models, migrations
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('configuration', '0002_auto_20141002_0204'),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name='configuration',
+            name='comment',
+            field=models.CharField(default='', max_length=512, verbose_name='commentaire', blank=True),
+            preserve_default=False,
+        ),
+    ]

+ 2 - 0
coin/configuration/models.py

@@ -26,6 +26,8 @@ class Configuration(PolymorphicModel):
     offersubscription = models.OneToOneField(OfferSubscription,
                                              related_name='configuration',
                                              verbose_name='abonnement')
+    comment = models.CharField(blank=True, max_length=512,
+                               verbose_name="commentaire")
 
     @staticmethod
     def get_configurations_choices_list():

+ 18 - 0
coin/vpn/migrations/0002_remove_vpnconfiguration_comment.py

@@ -0,0 +1,18 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import models, migrations
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('vpn', '0001_initial'),
+    ]
+
+    operations = [
+        migrations.RemoveField(
+            model_name='vpnconfiguration',
+            name='comment',
+        ),
+    ]

+ 0 - 2
coin/vpn/models.py

@@ -38,8 +38,6 @@ class VPNConfiguration(CoinLdapSyncMixin, Configuration):
                                      verbose_name="IPv6", blank=True, null=True,
                                      help_text="Adresse IPv6 utilisée par "
                                      "défaut sur le VPN")
-    comment = models.CharField(blank=True, max_length=512,
-                               verbose_name="commentaire")
 
     objects = NetManager()