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

Peter Kovacs leginee at gmail.com
Fri Apr 17 23:11:40 UTC 2015


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
;

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.

Peter

> Am 17.04.2015 um 12:24 schrieb François K. <daitheflu at free.fr>:
> 
> Hi Lucien,
> 
> Thanks a lot for your blazingly fast answer :D
> 
>> Can't you simply make the hard-coded entries dynamic too. Just add a
>> column in the db saying that these entries are the hardcoded ones ?
> 
> Sadly, nope, I can't hard-code them in the database because they are entry point to a different view on the same data.
> 
> To make things more clear, I'm building a to-do app. The first screen is a list where the first items are : "Today", "Overdue", "Completed", "Trash", ...
> And then, I want to have the list of "Projects" (which are gathered from the database entries).
> 
> "Today", "Overdue", etc... can't be added as Projects in the database, it makes no sense :(
> 
> 
>> And when doing db stuff, don't forget to use transactions. It can
>> help speeding up stuff a lot.
> 
> Thanks for this advice. I'll do my best to respect this and use transactions everywhere.
> 
> 
> Cheers,
> 
> -- 
> François
> _______________________________________________
> SailfishOS.org Devel mailing list
> To unsubscribe, please send a mail to devel-unsubscribe at lists.sailfishos.org


More information about the Devel mailing list