Composite primary keys are great and relating two records together is best done using them. Adding another field just to identify the relationship makes the table un-normalized (that isn’t a word is it?) and we all want our tables normalized don’t we? So it is common practice for (good) database designs to use them anywhere two records are being related.
Unfortunately Django doesn’t support them right now, at least not without some nasty hacks. This means every time you get your hands on a legacy database there is a high likelihood that there will be composite primary keys are in use and you will be in for a world of pain if you wish to integrate it with Django. I’ve been there and the hacks are nasty, and also mean you can’t use a lot of components such as the admin which makes me sad as the admin is a beautiful thing.
The ticket (http://code.djangoproject.com/ticket/373) has been around for 5 years with only one person taking a decent crack at it and he seems to have stopped working on it around the same time the core team was working on 1.0. So I have started on the path of getting Django to support them. And this doesn’t just mean working on the ORM part of Django, it means getting every part of Django to understand that a primary key doesn’t just mean one column/field. Not a small project by any means but it will show some pay-offs in the short term as it replaces the hacks I currently have in place.
Once I have some code to show it will be up on my github http://github.com/hartror
I habitually go to hacker news a few times a day, the people are intelligent and the discussion is the right mixture of coding, entrepreneurial and geek. It is also the first site I’ve consistently commented on, the karma feedback from writing an insightful comment is quite effective.
I work as the head of development at a startup and I refer to this site regularly. The author, Eric Ries, has an excellent writing style that combines the best of narrative and technical writing to highlight the lessons he draws from his experiences in the trenches.
I want to work with this guy, but I am afraid that the only way I will ever get job satisfaction again will be to run my own company, which probably isn’t a bad thing. His articles inform and inspire developers the world over to question how and what they do and generally do an all round better job.
Scott Berkun’s book Making Things Happen has been my bible in the project managerial baptism of fire I experienced. His website has a varied focus but I always seem to find it applicable to my situation, weather it is dealing with deadlines, people or public speaking.
I am continually reading about programming, software engineering and project management, both on the net and in dead tree form, my latest dead tree being Effective C++ by Scott Meyers. This reading is out of a desire to be a better developer, and today I though: but why do I seek to be a better developer? A little bit of the drive to better myself comes from the usual suspects, monetary gain, respect from my peers and suchlike. But for the most part I want to feel like I am doing a good job at something that I love, that how well I perform is important to me for its own sake rather than from some external pressure.
This means that if I hate what I am working on or am unable to complete it to my own satisfaction I have to take care not to fall into a funk, professional pride has its drawbacks (though feel and hope are overwhelmed by its advantages). So to manage this what do I do? Well I am fortunate to have an innumerable number of hobbies that I can draw professional pride from, programming being a major one, cooking being another. And then I always have learning, the discovery of new techniques and coming to new understandings is often the best way to for me to create that feeling of self worth we all seek.