[moving this over to django-users, where it belongs]

On Nov 20, 2005, at 8:43 PM, Ivan Fedorov wrote:
I'm need to manage catalog of products in my site with multilevel
structure. How can I'm create model, which can have parents of same type
as model?..

something like that:

class Category(meta.Model):

    name = meta.CharField(maxlength=500)
    parent = meta.ForeignKey(Category)

You want::

        parent = meta.ForeignKey('self')

See http://www.djangoproject.com/documentation/model_api/ #relationships and http://www.djangoproject.com/documentation/models/ m2o_recursive/

Jacob

Reply via email to