September 27, 2008
Do you know redmine ? This is, to my knowledge, the best project manager you could ever find out there. I like to describe it as ‘trac done well‘. It has only one, big, ugly, fat inconvenient for me : it is written on top of ruby on rails. I could tell you how slow it is (true), or how many security flaws are found everyday in the ruby/rails world. But the real reason I’m actually really concerned about ruby/rails is that I don’t know ruby. When I look at the code I don’t understand anything, and I can’t change something to ‘suit my needs’, as is so common in Free Software.
I wish it was written in Django.
Well, anyway, I spent some times today to create a small Django application in order to display stuff from the redmine database. For this, I’ve used the wonderful “inspectdb” feature of Django, which access a database and creates the (Django) models required to access it.
Then, I had to ‘adapt’ those models and to create an admin.py file so that I could browse (and even modify) the database from django.
- removing all the “id” field, they are automatically created by Django and it seems rails use the very same name (“id”) so this is compatible.
- Change the “obvious” references to other model from IntegerField to ForeignKey
- Some models reference themselves, you need to use a ForeignKey to ‘self’ (including quotes) to do that.
- add some __unicode__(self) for the most important/obvious models
The admin works was basically about:
- Creates Admin objects for all models (thanks vim’s macro!)
- add list_display / list_filter args for the most important ones
And the remaining problem is :
- It seems Boolean from ruby/rails have the values ‘t’/’f’ while those from django have 1/0 (fixed since then)
Mandatory screenshot (corresponding to the public stuff from http://labs.freehackers.org):