From 65bed3241d2e5546841f2c370449d67426022a27 Mon Sep 17 00:00:00 2001 From: Jacob Kaplan-Moss Date: Wed, 20 Jul 2005 21:24:03 +0000 Subject: [PATCH] Added note about ForeignKey("self"); fixes #100 git-svn-id: http://code.djangoproject.com/svn/django/trunk@254 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- docs/model-api.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/model-api.txt b/docs/model-api.txt index 756e19c7b6..f605f77756 100644 --- a/docs/model-api.txt +++ b/docs/model-api.txt @@ -304,6 +304,11 @@ Field Types many toppings on a pizza):: meta.ForeignKey(Pizza) + + .. admonition:: Note + + To create a recursive relationship, use a ``ForeignKey`` that relates + to ``"self"`` (i.e. ``meta.ForeignKey("self")``). ``ForeignKey`` fields take a large number of extra arguments for defining how the relationship should work. All are optional: