Answer the question
In order to leave comments, you need to log in
How to make a Django + PostgreSQL recursive query?
Hello!
There is a model:
class Task(models.Model):
title = models.CharField()
relates_to = models.ForeignKey('self')
Answer the question
In order to leave comments, you need to log in
Might be worth considering MPTT ( django-mptt ). Natively, without crutches, without recursions, the fastest read requests, a subtree with 12 levels and 4 sons for each internal node, is obtained in one request (instead of 5.5 million requests).
Of the minuses - a long time to record.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question