瀏覽代碼

add est parent option

Mr Duhaz 10 月之前
父節點
當前提交
b4ecc4b8cc

+ 6 - 0
.gitignore

@@ -19,3 +19,9 @@ migrations/__pycache__/0007_auto_20231201_1455.cpython-312.pyc
 migrations/__pycache__/0008_speed_dial_sd_icone.cpython-312.pyc
 migrations/__pycache__/0009_speed_dial_sd_color.cpython-312.pyc
 migrations/__pycache__/0010_auto_20231222_1114.cpython-312.pyc
+migrations/__pycache__/0011_auto_20240118_2009.cpython-312.pyc
+migrations/__pycache__/0011_auto_20240118_2011.cpython-312.pyc
+migrations/__pycache__/0011_auto_20240118_2016.cpython-312.pyc
+migrations/__pycache__/0011_alter_page_p_menu_parent.cpython-312.pyc
+migrations/__pycache__/0012_page_p_menu_est_parent.cpython-312.pyc
+migrations/__pycache__/0013_alter_page_p_menu_parent.cpython-312.pyc

+ 19 - 0
migrations/0011_alter_page_p_menu_parent.py

@@ -0,0 +1,19 @@
+# Generated by Django 3.2.23 on 2024-01-18 20:42
+
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('core', '0010_auto_20231222_1114'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='page',
+            name='p_menu_parent',
+            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='core.page', verbose_name='Parent'),
+        ),
+    ]

+ 18 - 0
migrations/0012_page_p_menu_est_parent.py

@@ -0,0 +1,18 @@
+# Generated by Django 3.2.23 on 2024-01-18 20:58
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('core', '0011_alter_page_p_menu_parent'),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name='page',
+            name='p_menu_est_parent',
+            field=models.BooleanField(default=False, verbose_name='Utilisé comme parent'),
+        ),
+    ]

+ 19 - 0
migrations/0013_alter_page_p_menu_parent.py

@@ -0,0 +1,19 @@
+# Generated by Django 3.2.23 on 2024-01-18 20:59
+
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('core', '0012_page_p_menu_est_parent'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='page',
+            name='p_menu_parent',
+            field=models.ForeignKey(blank=True, limit_choices_to={'p_menu_est_parent': True}, null=True, on_delete=django.db.models.deletion.PROTECT, to='core.page', verbose_name='Parent'),
+        ),
+    ]

+ 1 - 1
models.py

@@ -58,7 +58,7 @@ class Page (models.Model) : #Architecture pour les pages static est dynamique
 	p_adresse = models.CharField("Adresse", max_length = 64)
 	p_menu_position = models.CharField("A utiliser dans un menu ?",choices=menu_pos, max_length=4, default='no')
 	p_menu_est_parent = models.BooleanField("Utilisé comme parent", default = False)
-	p_menu_parent = models.ForeignKey('self',verbose_name="Parent", blank = True, null=True, on_delete=models.PROTECT, limit_choices_to={'p_menu_est_parent': True})
+	p_menu_parent = models.ForeignKey('self',verbose_name="Parent", blank = True, null = True, on_delete=models.PROTECT, limit_choices_to={'p_menu_est_parent': True})
 	p_menu_poid = models.PositiveSmallIntegerField("Poid si utilisé dans les menus", default=50)
 	p_mots_clefs = models.CharField("Mots clefs", max_length = 512, blank = True)
 	p_description = models.TextField("Description", blank = True)