← Back to team overview

gtg team mailing list archive

Migrating Task to TreeNode

 

Hello,

In the process of my refactorization, I will have to mak Task() a
TreeNode.

But I have some questions about Tree() and TreeNode() because that class
definitely needs some comments and some love.



1) Why are there multiple nodes with the same ID????? Why, when I do a
get_nodes(id), do I receive a list ? This seems very very very strange for
me. 


2) Why, when removing a node, should I provide both the ID and the node
itself ? What is the meaning of that ? Removing should take the ID only.


3) What is the self.ids of a TreeNode? I don't get it. It seems to contain
the IDs of children then why isn't self.children a dic ?

4) Why does add_child need both id and child_object. It should be the
object alone. (I guess the answer will be the same as for question 2)



Once I have answer to those questions, I will refactor a bit the Tree
class then make Task a TreeNode so the Trees are directly built in the
datastore and finally refactor the requester to take that into account (and
also to make it easier after reading Bryce's comments on it)


Lionel