Any help?

Le samedi 8 novembre 2008 07:58:00 UTC+1, sunn a écrit :
>
> How do I make a foreign key to self? 
>
> class Page(models.Model): 
>     title = models.CharField(max_length=128) 
>     display = models.CharField(max_length=64) 
>     path = models.CharField(max_length=64) 
>     sortorder = models.IntegerField() 
>     parent = models.OneToOneField(Page) #Will not work neither will 
>     parenttest = models.ForeignKey(Page) #nor 
>     parenttest2 = models.ForeignKey(self) 
>     def __unicode__(self): 
>         return self.display 
>
> any help appreciated! 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to