Answer the question
In order to leave comments, you need to log in
Django and ForeignKey?
There is this model:
class Menu(models.Model): <br>
name = models.CharField(max_length=255)<br>
.... <br>
parent = models.ForeignKey('self', null=True, blank=True)
menu = Menu.objects.filter(parent__isnull=True)
SELECT "menu_menu".*<br>
FROM "menu_menu"<br>
LEFT OUTER JOIN "menu_menu" T2 ON ("menu_menu"."parent_id" = T2."id")<br>
WHERE T2."id" IS NULL<br>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question