I need help building a data structure for a state diagram

Matthew Wilson matt at tplus1.com
Sun May 24 14:16:49 EDT 2009


I'm working on a really simple workflow for my bug tracker.  I want
filed bugs to start in an UNSTARTED status.  From there, they can go to
STARTED.

>From STARTED, bugs can go to FINISHED or ABANDONED.

I know I can easily hard-code this stuff into some if-clauses, but I
expect to need to add a lot more statuses over time and a lot more
relationships.

This seems like a crude state diagram.  So, has anyone on this list done
similar work?

How should I design this so that users can add arbitrary new statuses
and then define how to get to and from those statuses?

TIA

MAtt



More information about the Python-list mailing list