Re: Items tree in Django

2008-11-19 Thread Steve Holden
Malcolm Tredinnick wrote: > > On Mon, 2008-11-17 at 11:07 -0800, Gustavo Picón wrote: > [...] >> So the usual recommendation is: >> >> - if you're going to insert a lot more than you read, use adjacency >> list >> - if, as is the most common case, you're going to read your tree more >> than you

Re: Items tree in Django

2008-11-18 Thread Gustavo Picón
On Nov 18, 7:16 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Mon, 2008-11-17 at 11:07 -0800, Gustavo Picón wrote: > > [...] > > > So the usual recommendation is: > > > - if you're going to insert a lot more than you read, use adjacency > > list > > - if, as is the most common case, y

Re: Items tree in Django

2008-11-18 Thread Malcolm Tredinnick
On Mon, 2008-11-17 at 11:07 -0800, Gustavo Picón wrote: [...] > So the usual recommendation is: > > - if you're going to insert a lot more than you read, use adjacency > list > - if, as is the most common case, you're going to read your tree more > than you insert nodes, use nested sets or mat

Re: Items tree in Django

2008-11-18 Thread Malcolm Tredinnick
On Mon, 2008-11-17 at 22:30 +0100, Fabio Natali wrote: > Hi Malcom! And thank you very much for your kind reply. > > Malcolm Tredinnick wrote: > [...] > > 500 leaves is really nothing for the database. If you want to do > > anything with that size tree, you can easily just use a simple nested >

Re: Items tree in Django

2008-11-17 Thread Fabio Natali
Gustavo Picón wrote: [...] > Disclaimer: I'm the author of django-treebeard Hi Gustavo, thanks for your reply and for your django-treebeard, which I'll surely use very soon! > You can look at the treebeard benchmarks in > http://django-treebeard.googlecode.com/svn/docs/index.html#module-tbbench

Re: Items tree in Django

2008-11-17 Thread Fabio Natali
Hi Malcom! And thank you very much for your kind reply. Malcolm Tredinnick wrote: [...] > 500 leaves is really nothing for the database. If you want to do > anything with that size tree, you can easily just use a simple nested > hierarchy like this, pull all the rows back into Python and work wit

Re: Items tree in Django

2008-11-17 Thread Gustavo Picón
Disclaimer: I'm the author of django-treebeard > I am glad to hear that the naive way could possibly fit my 3-levels > tree, or at least that it deserves a try. I'll have some benchmarks as > you suggest. You can look at the treebeard benchmarks in http://django-treebeard.googlecode.com/svn/docs

Re: Items tree in Django

2008-11-17 Thread Malcolm Tredinnick
On Mon, 2008-11-17 at 11:46 +0100, Fabio Natali wrote: [...] > The point is, how can I create the root of my tree? Should I add some > "blank=True, null=True" properties to my Node model? So to have: > > class Node(models.Model): > name = models.CharField(max_length=50) > parent = models

Re: Items tree in Django

2008-11-17 Thread Fabio Natali
bruno desthuilliers wrote: [...] > > I've been told to use django-treebeard > > That's what I was about to suggest !-) > If you are really confident that your hierarchy will never grow deeper > than three levels, the above solution might be good enough. But it's > still less efficient than the m

Re: Items tree in Django

2008-11-17 Thread bruno desthuilliers
On 17 nov, 11:46, Fabio Natali <[EMAIL PROTECTED]> wrote: > Hi everybody out there! :-) > > I have to cope with a few hundreds item tree/hierarchy in my Django > project. Specifically, I'll have 500 hundreds leaves in a 3-levels > tree with a dozen branches. > > I won't need much writing over this

Items tree in Django

2008-11-17 Thread Fabio Natali
Hi everybody out there! :-) I have to cope with a few hundreds item tree/hierarchy in my Django project. Specifically, I'll have 500 hundreds leaves in a 3-levels tree with a dozen branches. I won't need much writing over this tree, I'll just need to read it and show data in a drop down menu. I