I’ve always disliked having to write __repr__ methods for my classes. It isn’t hard, it is just tedious. In Django, it is especially important to make them, since the admin pages use that method when listing objects from the data model.
However, since Python allows classes to have multiple inheritance, I have long since made a helper “Mixin” class to remove most of the pain from writing my __repr__ methods. If you haven’t heard the term, a “Mixin” is a class which adds functionality to classes which inherit from it. The philosophy is that it shouldn’t change base functionality, thus avoiding many of the problems with multiple inheritance.
Philosophy aside, mixins can be extremely useful, and I love this one. [Read more...]

This summer, I’ve been converting my biggest site,
This weekend I wrote my first
Just a few days ago, I was talking about how much I enjoy PySqlite, and now I’ve found another great tool for my SQL war chest.
At work, I’m doing a bunch of data acquisition on various machines outside the firewall. I think I’ve hit on an absolutely great combination of Python technologies to do this in a really manageable and scalable manner.
I’m pleased to report that the
Despite my earlier
Recent Comments