← Back to team overview

gtg-contributors team mailing list archive

Re: pushing a relationship from the backend

 

On Tue, Aug 3, 2010 at 10:28 AM, Lionel Dricot <ploum@xxxxxxxxx> wrote:
> Hi,
>
> This question is mainly for Luca.
>
> Currently, we are building a task object (including all the relationships)
> then, the backend push that task in the datastore.
>
> Does it makes more sense to, instead, make the backend pushing tasks and
> relationships separately ? Current crash in the liblarch_migration branch
> is due to the fact that we try to create the relationship inside the task
> while that task has not yet been added to a tree.

That's a possibility. The problem is that the backends that have
relationship between tasks are likely to store that information inside
their task object, so the backend should take care of caching that
information.
An easier approach would be one that I've already tested for the
couchdb backend:

- the backend fetches a task to push
- if the task Z has a non-yet-loaded parent/child A, it creates a
stub-task (an empty task with the id of A) and sets its modification
time to the very very past.
- when the real A is loaded by the backend, it updates the  stub version of A

This way, the backend does not need to store information about
relationships and the tree relationships are always between loaded
tasks.
Problem is that we might have "(New Task)" objects popping up while
loading the tasks. Maybe we could resolve that via a filter?



>
>
> >From a liblarch perspective, it means exposing the new_relationship
> function. To me, it also makes some sense as I'm trying to have all that
> relationship stuffs completely out of the task and maintened only in the
> tree (the rationale behind it is that relationship is function of the
> filters and that I want to unify everything as being a view of a tree,
> removing the concept of the "real tree" and "real relationships". A nice
> side effect would be that a node could be part of multiple trees)
>
> I'm currently coding that to see how it works but I'm not familiar with
> the @decorator.
>
> Lionel
>
> _______________________________________________
> Mailing list: https://launchpad.net/~gtg-contributors
> Post to     : gtg-contributors@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~gtg-contributors
> More help   : https://help.launchpad.net/ListHelp
>



Follow ups

References