On Mon, 2007-03-26 at 22:51 +0000, [EMAIL PROTECTED] wrote:
> http://www.djangoproject.com/documentation/model-api/#many-to-one-relationships
> 
> class Section(models.Model):
>     parent = models.ForeignKey('self', <---- BAD
>     parent = models.ForeignKey('Section', <---- GOOD

I'm sorry, but that's not correct. To quote the very documentation you
pointed to:

        "To create a recursive relationship — an object that has a
        many-to-one relationship with itself — use
        models.ForeignKey('self'). "

It is correct to use "self" there.

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to