[ansel] datatree_order and datatree_parents questions

Chuck Hagenbuch chuck at horde.org
Mon May 10 19:42:48 PDT 2004


Quoting "Heath S. Hendrickson" <heath at outerspaceconsultants.com>:

> 1) Add the image to the start of the gallery
>     Actually, this like the easiest to implement as the datatree
> function reorder() will take care of the incrementing of all the
> existing images order value automatically.  I'll just have to make some
> tweaks to the delete function to make sure that we don't leave any gaps
> when an image is deleted (and this may not be necessary, but I haven't
> looked yet).

reorder() actually will now refuse to work on objects without parents, so this
won't work.

> 2) Add the image to the end of the gallery

I'd prefer this one. You have the number of images in the gallery - any reason
you can't set the new order to numImages + 1?

> Can someone provide a little background on why the full lineage is
> stored and not just the direct ascendant?  If it were only the direct
> parent, then it would make a number of things simpler, not the least of
> which are the image ordering issue I'm working on as well as the gallery
> and image move functions.

It'd also necessitate a lot of recursion to traverse the tree. Right 
now you can
get a full tree, no matter the depth, with a constant number of queries. This
won't be changing.

-chuck

--
"Regard my poor demoralized mule!" - Juan Valdez


More information about the ansel mailing list