[SailfishDevel] Build a Model with "fixed" items + "dynamic" ones

François K. daitheflu at free.fr
Mon Apr 20 09:19:00 UTC 2015


Hi Peter,

Thanks for your answer and your time :)


> I dont get it. A project status is a perfect field for a DB.
> The query would even group the project in the right way.
> 
> select status , projectname
>   from todolist
> group by statusRank
> ;

Currently, a task is represented that way :

uuid, description, status, due_date, project, [several others fields...]


A task *MUST* have a uuid, a description and a status (status being either 'pending', 'completed', 'deleted').
A task *CAN* have a due_date and CAN have a project.

With this, I want the first item of my list to be "Today" (so the user can quickly access all the tasks he has to do today). When the user selects this item, he would get a list of all tasks for which due_date is set and equals today, regardless of the project field (the user would get tasks from project 'Super project', 'House building', 'New server', and also tasks that don't have a project set.

The second item of the list would be "Overdue", and would list all tasks that have a due_date which is past "today", also regardless of the project field.

I have 6 fixed items like these.

Then, I want the user to be able to access his projects. So I'd like to list the existing projects (this is the dynamic part of the model) :
"Super project" would list all tasks that have the project field set to "Super project". In this case, I don't care about the due_date field. I just want the task belonging to this project.


> then you could have some code that goes through the objects
> print project { arraycontainer.projectname }
> If (arraycontainer[i+1].status <> arraycontainer[i].status) { print
> new_cat() };
> 
> sorry for the bad pseudocode but i hope you get the idea.my c++ is
> not good and i want to go to bed.

Nah, don't apologize, thank *you* for taking some time and trying to help me :)

Cheers,

-- 
François


More information about the Devel mailing list