I think, you will also need related_name parameter for your relating fields.
Regards,
Aidas Bendoraitis aka Archatas
On 1/5/07, Jorge Gajon <[EMAIL PROTECTED]> wrote:
Hi Aljosa,
On 1/4/07, Aljosa Mohorovic <[EMAIL PROTECTED]> wrote:
>
> i'm trying to create a model which referencing itself
Hi Aljosa,
On 1/4/07, Aljosa Mohorovic <[EMAIL PROTECTED]> wrote:
i'm trying to create a model which referencing itself and for this
code i get this error:
"name 'Chapter' is not defined"
how do i do this or something similar?
code:
>>>
from django.db import models
class Chapter(models.Mode
i'm trying to create a model which referencing itself
The documentation says :
To create a recursive relationship -- an object that has a many-to-one
relationship with itself -- use models.ForeignKey('self').
Chris
--~--~-~--~~~---~--~~
You received this me
i'm trying to create a model which referencing itself and for this
code i get this error:
"name 'Chapter' is not defined"
how do i do this or something similar?
code:
from django.db import models
class Chapter(models.Model):
name = models.CharField(maxlength=200)
content = m
4 matches
Mail list logo