[ditz-talk] sorting todo lists

William Morgan wmorgan-ditz at masanjin.net
Fri Sep 12 12:43:09 EDT 2008

Hi Thomas,

Reformatted excerpts from Thomas Nichols's message of 2008-09-11:
> Now I'm wondering how to get that ability to sort and filter my tasklist 
> using plugins. I've seen issue 3e079c58 at 
> http://ditz.rubyforge.org/ditz/issue-3e079c58deadcc32fd1f78782c924324d29e4cdf.html
> but I'm not sure what's envisaged for this.  If I add a new 'priority' 
> field, what's the best way to get 'ditz todo' to sort the list by
> priority? Am I best monkey-patching Operator and defining
> todo_list_by_priority, or is there an approach based on Hooks /
> plugins I haven't fathomed yet?

In this particular case, I will probably add a sort_order field to
Issue, modify Operator#todo_list_for to use it, and the priority plugin
will be monkey-patching that method. But yes, that's the general
technique for plugins: monkey-patch to add (and occasionally modify)
methods and fields in ModelObject subclasses, and methods in Operator.

The trick is to restructure the base Ditz classes in such a way that the
monkey-patching is minimized. Allowing plugins to modify the todo list
output, for example, is something I need to find a nice clean way to do.

> I've also got the latest github ditz / sheila / camping code set up, and 
> with the addition of edit/start/close/comment actions this could be very 
> useful -- but from recent comments I'm not sure whether there are plans 
> to add such support. Any thoughts on extending Sheila to handle fields 
> defined by plugins?

My immediate plans for Sheila are to make it a simple web interface for
public, non-developer bug reports, so it will probably only support
adding of issues and comments, and little else. The intention is to
support what I think will be the common case for projects using ditz:
you want to lower the bar for user-generated bug reports by providing a
web interface, but developers will mostly work through the ditz
commandline, and that's how they'll triage, resolve, and edit issues.

Of course it's possible to have a more full-fledged web interface with
logins, issue modification, and all that stuff, but that gets more
complicated, so I'm envisioning that being further down the road. I have
to be careful not to start building JIRA.

William <wmorgan-ditz at masanjin.net>

More information about the ditz-talk mailing list