Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.

#1 Nov. 21, 2005 02:59:50

Jacob K.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Tree structure




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

something like that:

class Category(meta.Model):

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

parent = meta.ForeignKey('self')Seehttp://www.djangoproject.com/documentation/model_api/#relationships andhttp://www.djangoproject.com/documentation/models/m2o_recursive/Jacob

Offline

Board footer

Moderator control

Enjoy the 20th of January
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support