The model I'm using at the moment essentially has three classes. A root class, a tree attached to the root class and a leaf node class that can be attached anywhere in the tree.
e.g. Shop/Category/Product or Shop/Category/Category/Product
Product can only be linked to category. Category can either be linked to another category or shop.
I would use a generic foreign key to link the category to the shop or another category, but as Category is a tree it needs a TreeForeignKey field. I'm looking for example of how this can be done in models.py or an alternative way of achieving the same thing.