On 24/10/2011 3:47pm, Ken wrote:
I want to create a parent-child like catalog system.

from django.db import models

class Catalog(models.Model):
     username = models.EmailField()
     name = models.CharField(max_length=64)
     color = models.CharField(max_length=20)
     state = models.IntegerField()
     parentcatalog = models.ManyToOneRel(Catalog)

but when syncdb i got:
   File "/home/ken/sites/mysite/catalog/models.py", line 12, in Catalog
     parentcatalog = models.ManyToOneRel(Catalog)
NameError: name 'Catalog' is not defined

It seems like I cannot ref to a model which is not completely defined.
What should I do?

With any luck you should be able to put Catalog in quotes so it is a string rather than an undefined object.


--
You received this message because you are subscribed to the Google
Groups "Django users" group.
To post to this group, send email to [email protected].
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.

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to [email protected].
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