6

Is anyone aware of a Django app for designing and storing flowcharts in a database? After searching for variations of "Django flowcharts", I've only found flowcharts of Django's internal design, not anything about authoring or storing flowcharts in a Django webapp.

As asked in a similar question, I've found several impressive Javascript and JQuery based libraries for browser-based flowchart design, but nothing for persisting these server-side.

Community
  • 1
  • 1
Cerin
  • 60,957
  • 96
  • 316
  • 522

3 Answers3

1

Why couldn't you do it yourself? The behavior and presentation is already implemented in the several truly impressive JavaScript libraries you've referenced, now all that's left to be done is to store the models in the database for your favorite pick you'd like to persist through Django.

There is a library that implements Modified Preorder Tree Traversal on the model level that I'm sure would be of great use to you to store the logical relations between the flowchart elements and other presentation data, such as the coordinates, shape, it's transformations and other visual properties can be easily stored alongside.

I'm sure that if you'd give it some thought you could quickly execute it; hell it's even probable that there are many people who need the same thing, which would make it even more useful if you weren't developing it just for yourself. This seems like a good candidate for an OS Django app.

Filip Dupanović
  • 32,650
  • 13
  • 84
  • 114
  • 1
    Of course doing myself is always an option. I'm just doing my do diligence to research prior art, to avoid reinventing the wheel. – Cerin Dec 15 '11 at 22:50
1

I wrote an app that stores and controls state machines in Django 1.2:

https://bitbucket.org/canassa/zinaflow

It uses a per-object permission model for controlling the transitions and GenericForeignKeys for attaching the state machine to any model in your application. With the per-object permissions you can assign a Django user for each transition.

Depending on what you need to do, this app might be a overkill for you. But reading the source code can give you some ideias on how to implement an app yourself.

Cesar Canassa
  • 18,659
  • 11
  • 66
  • 69
  • Very cool project. My aim is something similar, but with more emphasis on automated control logic within the state machine. – Cerin Dec 15 '11 at 22:48
  • Thanks! for automated logic you should use the Django signals. Just fire an event when a flowchart changes and let the other apps listen to it and respond accordingly. – Cesar Canassa Dec 16 '11 at 00:20
  • I mean support for logic nodes in traditional flowcharts that select from multiple possible transitions. It looks like your model assumes a straight linear flow, where one state is linked to one and only one other state by one and only one transition. – Cerin Dec 16 '11 at 13:47
  • The Zinaflow supports multiple possible transitions. The Transition model has a destination and a origin, but you can have multiple instances of this transition object with the same origin but different destinations. The Model object has a `get_allowed_transitions` method that will return all possible transitions. – Cesar Canassa Dec 16 '11 at 14:12
  • this link "https://bitbucket.org/canassa/zinaflow " isn't avalable now – Youssri Abo Elseod Nov 21 '20 at 07:51
0

I am not aware of an existing app that does this, but if you want to start developing your own a good place to start would be exploring the code for GraphModels, a command from the excellent django-command-extensions project. It is a django manage.py extension that creates database diagrams from models using graphviz.

Burhan Khalid
  • 169,990
  • 18
  • 245
  • 284