Use the name of class instead:

parent = models.ForeignKey("Category", blank=True, null=True,
verbose_name=_("parent"))

2011/3/5 mohammad Efazati <moham...@efazati.org>

> I have model field foreign key to self
> but sql have error and cant create null field for field
> why?
>
> class Category(models.Model):
>     title = models.CharField(max_length=250,\
>                              unique=True, verbose_name=_("Title"))
>     slug = models.SlugField(max_length=100,\
>                             verbose_name=_("Slug"),\
>                             help_text=_("This Field will fill\
>                             automaticaly by title"))
>     parent = models.ForeignKey('self', blank=True, null=True,
> verbose_name=_("parent"))
>
> thanks
>
> --
> 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
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Ricardo Lapa Dani

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to