Mr Duhaz преди 10 месеца
родител
ревизия
3412fe7bf4
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. 2 1
      models.py

+ 2 - 1
models.py

@@ -57,7 +57,8 @@ class Page (models.Model) : #Architecture pour les pages static est dynamique
 	p_type = models.CharField("Type de page",choices=page_type, max_length=8, default='page')
 	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_parent = models.ForeignKey('self', blank = True, null=True, on_delete=models.PROTECT)
+	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_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)